requested changes
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
9fa81fe9eb
commit
9089ba7346
|
@ -1,2 +1,2 @@
|
||||||
INSERT INTO vn.payDem (id,payDem)
|
INSERT INTO `vn`.`payDem` (id,payDem)
|
||||||
VALUES (7,'0');
|
VALUES (7,'0');
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
ALTER TABLE vn.supplier MODIFY COLUMN payMethodFk tinyint(3) unsigned NULL;
|
ALTER TABLE `vn`.`supplier` MODIFY COLUMN payMethodFk tinyint(3) unsigned NULL;
|
|
@ -1 +1 @@
|
||||||
ALTER TABLE vn.supplier MODIFY COLUMN supplierActivityFk varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL NULL;
|
ALTER TABLE `vn`.`supplier` MODIFY COLUMN supplierActivityFk varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL NULL;
|
|
@ -1,6 +1,6 @@
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
Self.remoteMethod('newSupplier', {
|
Self.remoteMethod('newSupplier', {
|
||||||
description: 'returns the created item',
|
description: 'Creates a new supplier and returns it',
|
||||||
accessType: 'WRITE',
|
accessType: 'WRITE',
|
||||||
accepts: [{
|
accepts: [{
|
||||||
arg: 'params',
|
arg: 'params',
|
||||||
|
@ -33,12 +33,11 @@ module.exports = Self => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const supplier = await models.Supplier.create(params, myOptions);
|
const supplier = await models.Supplier.create(params, myOptions);
|
||||||
|
console.log('supplier: ', supplier);
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
return {
|
return supplier;
|
||||||
supplier
|
|
||||||
};
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (tx) await tx.rollback();
|
if (tx) await tx.rollback();
|
||||||
return params;
|
return params;
|
||||||
|
|
|
@ -26,31 +26,7 @@ describe('Supplier newSupplier()', () => {
|
||||||
|
|
||||||
expect(createdSupplier.id).toEqual(result.id);
|
expect(createdSupplier.id).toEqual(result.id);
|
||||||
expect(createdSupplier.name).toEqual(result.name);
|
expect(createdSupplier.name).toEqual(result.name);
|
||||||
expect(createdSupplier.account).toBeNull();
|
|
||||||
expect(createdSupplier.nif).toBeNull();
|
|
||||||
expect(createdSupplier.phone).toBeNull();
|
|
||||||
expect(createdSupplier.retAccount).toBeNull();
|
|
||||||
expect(createdSupplier.commission).toBeFalse();
|
|
||||||
expect(createdSupplier.created).toBeDefined();
|
|
||||||
expect(createdSupplier.postcodeFk).toBeNull();
|
|
||||||
expect(createdSupplier.isActive).toBeTrue();
|
|
||||||
expect(createdSupplier.isOfficial).toBeTrue();
|
|
||||||
expect(createdSupplier.isSerious).toBeTrue();
|
|
||||||
expect(createdSupplier.note).toBeNull();
|
|
||||||
expect(createdSupplier.street).toBeNull();
|
|
||||||
expect(createdSupplier.city).toBeNull();
|
|
||||||
expect(createdSupplier.provinceFk).toBeNull();
|
|
||||||
expect(createdSupplier.postCode).toBeNull();
|
|
||||||
expect(createdSupplier.payMethodFk).toBeNull();
|
|
||||||
expect(createdSupplier.payDemFk).toEqual(7);
|
expect(createdSupplier.payDemFk).toEqual(7);
|
||||||
expect(createdSupplier.payDay).toBeNull();
|
|
||||||
expect(createdSupplier.nickname).toEqual(result.name);
|
expect(createdSupplier.nickname).toEqual(result.name);
|
||||||
expect(createdSupplier.workerFk).toBeNull();
|
|
||||||
expect(createdSupplier.sageTaxTypeFk).toBeNull();
|
|
||||||
expect(createdSupplier.sageTransactionTypeFk).toBeNull();
|
|
||||||
expect(createdSupplier.sageWithholdingFk).toBeNull();
|
|
||||||
expect(createdSupplier.isPayMethodChecked).toBeFalse();
|
|
||||||
expect(createdSupplier.supplierActivityFk).toBeNull();
|
|
||||||
expect(createdSupplier.healthRegister).toBeNull();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,13 +5,6 @@
|
||||||
insert-mode="true"
|
insert-mode="true"
|
||||||
form="form">
|
form="form">
|
||||||
</vn-watcher>
|
</vn-watcher>
|
||||||
<vn-crud-model
|
|
||||||
auto-load="true"
|
|
||||||
url="Origins"
|
|
||||||
data="originsData"
|
|
||||||
order="name"
|
|
||||||
vn-id="origin-model">
|
|
||||||
</vn-crud-model>
|
|
||||||
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
||||||
<vn-card class="vn-pa-lg">
|
<vn-card class="vn-pa-lg">
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
|
|
|
@ -9,13 +9,7 @@ class Controller extends Section {
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
this.$.watcher.submit().then(
|
this.$.watcher.submit().then(
|
||||||
json => {
|
json => {
|
||||||
this.$state.go('item.card.basicData', {id: json.data.id});
|
this.$state.go(`supplier.card.fiscalData`, {id: json.data.id});
|
||||||
|
|
||||||
redirect(this.$.$ctrl);
|
|
||||||
|
|
||||||
function redirect(ctrl) {
|
|
||||||
window.location.href = `/#!/supplier/${ctrl.supplier.supplier.id}/fiscal-data`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
"url": "/create",
|
"url": "/create",
|
||||||
"state": "supplier.create",
|
"state": "supplier.create",
|
||||||
"component": "vn-supplier-create",
|
"component": "vn-supplier-create",
|
||||||
|
"acl": ["administrative"],
|
||||||
"description": "New supplier"
|
"description": "New supplier"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue