requested changes
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Pau 2022-10-25 10:42:16 +02:00
parent 9fa81fe9eb
commit 9089ba7346
8 changed files with 8 additions and 45 deletions

View File

@ -1,2 +1,2 @@
INSERT INTO vn.payDem (id,payDem)
INSERT INTO `vn`.`payDem` (id,payDem)
VALUES (7,'0');

View File

@ -1 +1 @@
ALTER TABLE vn.supplier MODIFY COLUMN payMethodFk tinyint(3) unsigned NULL;
ALTER TABLE `vn`.`supplier` MODIFY COLUMN payMethodFk tinyint(3) unsigned NULL;

View File

@ -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;

View File

@ -1,6 +1,6 @@
module.exports = Self => {
Self.remoteMethod('newSupplier', {
description: 'returns the created item',
description: 'Creates a new supplier and returns it',
accessType: 'WRITE',
accepts: [{
arg: 'params',
@ -33,12 +33,11 @@ module.exports = Self => {
try {
const supplier = await models.Supplier.create(params, myOptions);
console.log('supplier: ', supplier);
if (tx) await tx.commit();
return {
supplier
};
return supplier;
} catch (e) {
if (tx) await tx.rollback();
return params;

View File

@ -26,31 +26,7 @@ describe('Supplier newSupplier()', () => {
expect(createdSupplier.id).toEqual(result.id);
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.payDay).toBeNull();
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();
});
});

View File

@ -5,13 +5,6 @@
insert-mode="true"
form="form">
</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">
<vn-card class="vn-pa-lg">
<vn-horizontal>

View File

@ -9,13 +9,7 @@ class Controller extends Section {
onSubmit() {
this.$.watcher.submit().then(
json => {
this.$state.go('item.card.basicData', {id: json.data.id});
redirect(this.$.$ctrl);
function redirect(ctrl) {
window.location.href = `/#!/supplier/${ctrl.supplier.supplier.id}/fiscal-data`;
}
this.$state.go(`supplier.card.fiscalData`, {id: json.data.id});
}
);
}

View File

@ -56,6 +56,7 @@
"url": "/create",
"state": "supplier.create",
"component": "vn-supplier-create",
"acl": ["administrative"],
"description": "New supplier"
},
{