diff --git a/api-payroll/src/settings.php b/api-payroll/src/settings.php index 4a54cdd..23e7d09 100644 --- a/api-payroll/src/settings.php +++ b/api-payroll/src/settings.php @@ -46,6 +46,18 @@ return [ 'employee' => [ 'codeLength' => '3', 'contractTypes' => array('INTERNO', 'EXTERNO'), + 'hoursPerWorkDay' => 8, + 'paymentperHour' => 30, + 'bonusPerDelivery' => 5, + 'perHourBonusDriver' => 10, + 'perHourBonusLoader' => 5, + 'perHourBonusAux' => 0, + 'BaseIsr' => 9, + 'extraIsr' => 3, + 'taxesAddUp' => true, // If true this will be total/(9 + 3) else they're subtracted separately + 'amountForExtraTaxes' => 16000, + 'vouchersForAllContractTypes' => false, // Outsourced personal won't get vouchers + 'percentOfPaymentForVouchers' => 4, ], ], ]; diff --git a/database/database.sql b/database/database.sql index 7163d96..b6466e0 100644 --- a/database/database.sql +++ b/database/database.sql @@ -73,3 +73,21 @@ CREATE TABLE IF NOT EXISTS `employees` ( PRIMARY KEY (`id`), UNIQUE (`code`) ); + +DROP TABLE IF EXISTS paymentsPerEmployeePerDay; +CREATE TABLE IF NOT EXISTS `paymentsPerEmployeePerDay` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `idEmployee` INT UNSIGNED NOT NULL comment 'The employee to who this payment will be made', + `date` DATE NOT NULL DEFAULT '1900-01-01' comment 'Date of the worked day', + `baseAmount` DOUBLE(10,2) NOT NULL DEFAULT 0.0 comment 'Amount paid for the hours worked', + `bonusTime` DOUBLE(10,2) NOT NULL DEFAULT 0.0 comment 'Bonus paid for the hours worked', + `deliveries` DOUBLE(10,2) NOT NULL DEFAULT 0.0 comment 'Bonus for the number of deliveries', + `taxes` DOUBLE(10,2) NOT NULL DEFAULT 0.0 comment 'Substracted amout for taxes', + `vouchers` DOUBLE(10,2) NOT NULL DEFAULT 0.0 comment 'Amout given in vouchers', + `status` ENUM('ACTIVE', 'INACTIVE') NOT NULL DEFAULT 'ACTIVE', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP comment 'The date on which the registry was created', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment 'The date of the last time the row was modified', + PRIMARY KEY (`id`), + FOREIGN KEY (idEmployee) REFERENCES employees(id), + UNIQUE (`idEmployee`, `date`) +);