2940-invoiceInTax-section #680
|
@ -3,4 +3,6 @@ DELETE FROM `salix`.`ACL` WHERE id = 188;
|
||||||
UPDATE `salix`.`ACL` tdms SET tdms.accessType = '*'
|
UPDATE `salix`.`ACL` tdms SET tdms.accessType = '*'
|
||||||
WHERE tdms.id = 165;
|
WHERE tdms.id = 165;
|
||||||
INSERT INTO salix.ACL (model, principalId, property, accessType)
|
INSERT INTO salix.ACL (model, principalId, property, accessType)
|
||||||
VALUES ('InvoiceInTax','administrative', '*', '*');
|
VALUES ('InvoiceInTax','administrative', '*', '*');
|
||||||
|
INSERT INTO salix.ACL (model, principalId, property, accessType)
|
||||||
|
VALUES ('InvoiceInLog','administrative', '*', 'READ');
|
|
@ -22,20 +22,18 @@ describe('InvoiceIn', () => {
|
||||||
controller.invoiceIn = {id: 1};
|
controller.invoiceIn = {id: 1};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe('setTaxRate() setter', () => {
|
describe('taxRate()', () => {
|
||||||
it('should set tax rate with the Sage tax type value', () => {
|
it('should set tax rate with the Sage tax type value', () => {
|
||||||
const taxTypeSage = {
|
const taxRateSelection = {
|
||||||
rate: 21
|
rate: 21
|
||||||
};
|
};
|
||||||
$scope.taxTypeSage = {};
|
const invoiceInTax = {
|
||||||
$scope.taxTypeSage.selection = taxTypeSage;
|
taxableBase: 200
|
||||||
|
};
|
||||||
|
|
||||||
$scope.taxableBase = {};
|
const taxRate = controller.taxRate(invoiceInTax, taxRateSelection);
|
||||||
$scope.taxableBase.value = 200;
|
|
||||||
|
|
||||||
controller.taxRateSelection = 0;
|
expect(taxRate).toEqual(42);
|
||||||
|
|
||||||
expect(controller.taxRate).toEqual(42);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue