3491-ticket_volume #847
|
@ -0,0 +1,25 @@
|
||||||
|
ALTER TABLE `postgresql`.`business` ADD payedHolidays INT NULL;
|
||||||
|
ALTER TABLE `postgresql`.`business` CHANGE payedHolidays payedHolidays INT NULL AFTER reasonEndFk;
|
||||||
|
|
||||||
|
CREATE OR REPLACE
|
||||||
|
ALGORITHM = UNDEFINED VIEW `vn`.`workerLabour` AS
|
||||||
|
select
|
||||||
|
`b`.`business_id` AS `businessFk`,
|
||||||
|
`p`.`id_trabajador` AS `workerFk`,
|
||||||
|
`bl`.`workcenter_id` AS `workCenterFk`,
|
||||||
|
`b`.`date_start` AS `started`,
|
||||||
|
`b`.`date_end` AS `ended`,
|
||||||
|
`d`.`id` AS `departmentFk`,
|
||||||
|
`b`.`payedHolidays` AS `payedHolidays`
|
||||||
|
from
|
||||||
|
((((`postgresql`.`person` `p`
|
||||||
|
join `postgresql`.`profile` `pr` on
|
||||||
|
((`pr`.`person_id` = `p`.`person_id`)))
|
||||||
|
join `postgresql`.`business` `b` on
|
||||||
|
((`b`.`client_id` = `pr`.`profile_id`)))
|
||||||
|
join `postgresql`.`business_labour` `bl` on
|
||||||
|
((`b`.`business_id` = `bl`.`business_id`)))
|
||||||
|
join `vn`.`department` `d` on
|
||||||
|
((`d`.`id` = `bl`.`department_id`)))
|
||||||
|
order by
|
||||||
|
`b`.`date_start` desc
|
|
@ -1292,11 +1292,11 @@ INSERT INTO `vn`.`supplierAddress`(`id`, `supplierFk`, `nickname`, `street`, `pr
|
||||||
(5, 442, 'GCR building', 'Bristol district', 1, '46000', 'Gotham', '111111111', '222222222'),
|
(5, 442, 'GCR building', 'Bristol district', 1, '46000', 'Gotham', '111111111', '222222222'),
|
||||||
(6, 442, 'The Gotham Tonight building', 'Bristol district', 1, '46000', 'Gotham', '111111111', '222222222');
|
(6, 442, 'The Gotham Tonight building', 'Bristol district', 1, '46000', 'Gotham', '111111111', '222222222');
|
||||||
|
|
||||||
INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`,`isFarmer`,`commission`, `created`, `isActive`, `street`, `city`, `provinceFk`, `postCode`, `payMethodFk`, `payDemFk`, `payDay`, `taxTypeSageFk`, `withholdingSageFk`, `transactionTypeSageFk`, `workerFk`, `supplierActivityFk`, `isPayMethodChecked`)
|
INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`, `commission`, `created`, `isActive`, `street`, `city`, `provinceFk`, `postCode`, `payMethodFk`, `payDemFk`, `payDay`, `taxTypeSageFk`, `withholdingSageFk`, `transactionTypeSageFk`, `workerFk`, `supplierActivityFk`, `isPayMethodChecked`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, 0, CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1),
|
(1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1),
|
||||||
(2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 1, 0, CURDATE(), 1, 'supplier address 2', 'SILLA', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1),
|
(2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 0, CURDATE(), 1, 'supplier address 2', 'SILLA', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1),
|
||||||
(442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, 0, CURDATE(), 1, 'supplier address 3', 'SILLA', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'flowerPlants', 1);
|
(442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, CURDATE(), 1, 'supplier address 3', 'SILLA', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'flowerPlants', 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`supplierContact`(`id`, `supplierFk`, `phone`, `mobile`, `email`, `observation`, `name`)
|
INSERT INTO `vn`.`supplierContact`(`id`, `supplierFk`, `phone`, `mobile`, `email`, `observation`, `name`)
|
||||||
VALUES
|
VALUES
|
||||||
|
|
|
@ -91,32 +91,26 @@
|
||||||
}
|
}
|
||||||
.icon-calc_volum .path1:before {
|
.icon-calc_volum .path1:before {
|
||||||
content: "\e915";
|
content: "\e915";
|
||||||
color: rgb(0, 0, 0);
|
|
||||||
}
|
}
|
||||||
.icon-calc_volum .path2:before {
|
.icon-calc_volum .path2:before {
|
||||||
content: "\e916";
|
content: "\e916";
|
||||||
margin-left: -1em;
|
margin-left: -1em;
|
||||||
color: rgb(0, 0, 0);
|
|
||||||
}
|
}
|
||||||
.icon-calc_volum .path3:before {
|
.icon-calc_volum .path3:before {
|
||||||
content: "\e917";
|
content: "\e917";
|
||||||
margin-left: -1em;
|
margin-left: -1em;
|
||||||
color: rgb(0, 0, 0);
|
|
||||||
}
|
}
|
||||||
.icon-calc_volum .path4:before {
|
.icon-calc_volum .path4:before {
|
||||||
content: "\e918";
|
content: "\e918";
|
||||||
margin-left: -1em;
|
margin-left: -1em;
|
||||||
color: rgb(0, 0, 0);
|
|
||||||
}
|
}
|
||||||
.icon-calc_volum .path5:before {
|
.icon-calc_volum .path5:before {
|
||||||
content: "\e919";
|
content: "\e919";
|
||||||
margin-left: -1em;
|
margin-left: -1em;
|
||||||
color: rgb(0, 0, 0);
|
|
||||||
}
|
}
|
||||||
.icon-calc_volum .path6:before {
|
.icon-calc_volum .path6:before {
|
||||||
content: "\e91a";
|
content: "\e91a";
|
||||||
margin-left: -1em;
|
margin-left: -1em;
|
||||||
color: rgb(255, 255, 255);
|
|
||||||
}
|
}
|
||||||
.icon-deliveryprices:before {
|
.icon-deliveryprices:before {
|
||||||
content: "\e91c";
|
content: "\e91c";
|
||||||
|
@ -144,7 +138,6 @@
|
||||||
}
|
}
|
||||||
.icon-invoice:before {
|
.icon-invoice:before {
|
||||||
content: "\e924";
|
content: "\e924";
|
||||||
color: #5f5f5f;
|
|
||||||
}
|
}
|
||||||
.icon-supplier:before {
|
.icon-supplier:before {
|
||||||
content: "\e925";
|
content: "\e925";
|
||||||
|
@ -160,7 +153,6 @@
|
||||||
}
|
}
|
||||||
.icon-shipment-01:before {
|
.icon-shipment-01:before {
|
||||||
content: "\e929";
|
content: "\e929";
|
||||||
color: #000;
|
|
||||||
}
|
}
|
||||||
.icon-inventory:before {
|
.icon-inventory:before {
|
||||||
content: "\e92b";
|
content: "\e92b";
|
||||||
|
@ -398,7 +390,6 @@
|
||||||
}
|
}
|
||||||
.icon-bucket:before {
|
.icon-bucket:before {
|
||||||
content: "\e97a";
|
content: "\e97a";
|
||||||
color: #000;
|
|
||||||
}
|
}
|
||||||
.icon-mandatory:before {
|
.icon-mandatory:before {
|
||||||
content: "\e97b";
|
content: "\e97b";
|
||||||
|
@ -411,7 +402,6 @@
|
||||||
}
|
}
|
||||||
.icon-invoices:before {
|
.icon-invoices:before {
|
||||||
content: "\e97f";
|
content: "\e97f";
|
||||||
color: #000;
|
|
||||||
}
|
}
|
||||||
.icon-grid:before {
|
.icon-grid:before {
|
||||||
content: "\e980";
|
content: "\e980";
|
||||||
|
|
|
@ -51,7 +51,7 @@ h1, h2, h3, h4, h5, h6 {
|
||||||
color: $color-main;
|
color: $color-main;
|
||||||
}
|
}
|
||||||
.text-secondary {
|
.text-secondary {
|
||||||
color: $color-font-secondary;
|
color: $color-font-light;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Helpers */
|
/* Helpers */
|
||||||
|
|
|
@ -179,7 +179,7 @@
|
||||||
ng-click="$ctrl.selectItem(item.id)">
|
ng-click="$ctrl.selectItem(item.id)">
|
||||||
<vn-td shrink>
|
<vn-td shrink>
|
||||||
<span
|
<span
|
||||||
ng-click="itemDescriptor.show($event, item.id)"
|
vn-click-stop="itemDescriptor.show($event, item.id)"
|
||||||
class="link">
|
class="link">
|
||||||
{{::item.id}}
|
{{::item.id}}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -296,7 +296,7 @@
|
||||||
ng-click="$ctrl.selectItem(item.id)">
|
ng-click="$ctrl.selectItem(item.id)">
|
||||||
<vn-td shrink>
|
<vn-td shrink>
|
||||||
<span
|
<span
|
||||||
ng-click="itemDescriptor.show($event, item.id)"
|
vn-click-stop="itemDescriptor.show($event, item.id)"
|
||||||
class="link">
|
class="link">
|
||||||
{{::item.id}}
|
{{::item.id}}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -38,7 +38,6 @@ module.exports = Self => {
|
||||||
'payDemFk',
|
'payDemFk',
|
||||||
'payDay',
|
'payDay',
|
||||||
'account',
|
'account',
|
||||||
'isFarmer',
|
|
||||||
'sageTaxTypeFk',
|
'sageTaxTypeFk',
|
||||||
'sageTransactionTypeFk',
|
'sageTransactionTypeFk',
|
||||||
'sageWithholdingFk',
|
'sageWithholdingFk',
|
||||||
|
@ -102,6 +101,11 @@ module.exports = Self => {
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
let supplier = await Self.app.models.Supplier.findOne(filter);
|
let supplier = await Self.app.models.Supplier.findOne(filter);
|
||||||
|
|
||||||
|
const farmerCode = 2;
|
||||||
|
if (supplier.sageWithholdingFk == farmerCode)
|
||||||
|
supplier.isFarmer = true;
|
||||||
|
|
||||||
return supplier;
|
return supplier;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,4 +25,12 @@ describe('Supplier getSummary()', () => {
|
||||||
|
|
||||||
expect(payMethod.name).toEqual('PayMethod one');
|
expect(payMethod.name).toEqual('PayMethod one');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it(`should get if supplier is farmer by sageWithholdingFk`, async() => {
|
||||||
|
const supplier = await app.models.Supplier.findById(2);
|
||||||
|
const supplierSummary = await app.models.Supplier.getSummary(2);
|
||||||
|
|
||||||
|
expect(supplier.isFarmer).toBeUndefined();
|
||||||
|
expect(supplierSummary.isFarmer).toEqual(true);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -27,9 +27,6 @@
|
||||||
"nif": {
|
"nif": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"isFarmer": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"phone": {
|
"phone": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
|
|
|
@ -112,6 +112,13 @@ module.exports = Self => {
|
||||||
|
|
||||||
const contracts = await models.WorkerLabour.find(filter, myOptions);
|
const contracts = await models.WorkerLabour.find(filter, myOptions);
|
||||||
|
|
||||||
|
let [firstContract] = contracts;
|
||||||
|
let payedHolidays;
|
||||||
|
|
||||||
|
if (firstContract.payedHolidays)
|
||||||
|
payedHolidays = firstContract.payedHolidays;
|
||||||
|
else payedHolidays = 0;
|
||||||
|
|
||||||
let totalHolidays = 0;
|
let totalHolidays = 0;
|
||||||
let holidaysEnjoyed = 0;
|
let holidaysEnjoyed = 0;
|
||||||
|
|
||||||
|
@ -166,8 +173,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
return isLeapYear(year) ? 366 : 365;
|
return isLeapYear(year) ? 366 : 365;
|
||||||
}
|
}
|
||||||
|
return {totalHolidays, holidaysEnjoyed, payedHolidays};
|
||||||
return {totalHolidays, holidaysEnjoyed};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function isLeapYear(year) {
|
function isLeapYear(year) {
|
||||||
|
|
|
@ -9,16 +9,19 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"businessFk": {
|
"businessFk": {
|
||||||
"id": true,
|
"id": true,
|
||||||
"type": "Number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"workerFk": {
|
"workerFk": {
|
||||||
"type": "Number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"started": {
|
"started": {
|
||||||
"type": "date"
|
"type": "date"
|
||||||
},
|
},
|
||||||
"ended": {
|
"ended": {
|
||||||
"type": "date"
|
"type": "date"
|
||||||
|
},
|
||||||
|
"payedHolidays": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
|
|
|
@ -28,6 +28,9 @@
|
||||||
{{'Used' | translate}} {{$ctrl.contractHolidays.holidaysEnjoyed}}
|
{{'Used' | translate}} {{$ctrl.contractHolidays.holidaysEnjoyed}}
|
||||||
{{'of' | translate}} {{$ctrl.contractHolidays.totalHolidays || 0}} {{'days' | translate}}
|
{{'of' | translate}} {{$ctrl.contractHolidays.totalHolidays || 0}} {{'days' | translate}}
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
{{'Paid holidays' | translate}} {{$ctrl.contractHolidays.payedHolidays}} {{'days' | translate}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="totalBox" style="text-align: center;">
|
<div class="totalBox" style="text-align: center;">
|
||||||
|
|
|
@ -71,6 +71,10 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get payedHolidays() {
|
||||||
|
return this._businessId;
|
||||||
|
}
|
||||||
|
|
||||||
buildYearFilter() {
|
buildYearFilter() {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
now.setFullYear(now.getFullYear() + 1);
|
now.setFullYear(now.getFullYear() + 1);
|
||||||
|
|
|
@ -8,4 +8,5 @@ days: días
|
||||||
Choose an absence type from the right menu: Elige un tipo de ausencia desde el menú de la derecha
|
Choose an absence type from the right menu: Elige un tipo de ausencia desde el menú de la derecha
|
||||||
To start adding absences, click an absence type from the right menu and then on the day you want to add an absence: Para empezar a añadir ausencias, haz clic en un tipo de ausencia desde el menu de la derecha y después en el día que quieres añadir la ausencia
|
To start adding absences, click an absence type from the right menu and then on the day you want to add an absence: Para empezar a añadir ausencias, haz clic en un tipo de ausencia desde el menu de la derecha y después en el día que quieres añadir la ausencia
|
||||||
You can just add absences within the current year: Solo puedes añadir ausencias dentro del año actual
|
You can just add absences within the current year: Solo puedes añadir ausencias dentro del año actual
|
||||||
Current day: Día actual
|
Current day: Día actual
|
||||||
|
Paid holidays: Vacaciones pagadas
|
File diff suppressed because it is too large
Load Diff
|
@ -9,7 +9,7 @@
|
||||||
"url": "https://gitea.verdnatura.es/verdnatura/salix"
|
"url": "https://gitea.verdnatura.es/verdnatura/salix"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=14"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bmp-js": "^0.1.0",
|
"bmp-js": "^0.1.0",
|
||||||
|
|
Loading…
Reference in New Issue