FIX : several merge errors

This commit is contained in:
Gauthier PC portable 024 2021-02-05 11:12:55 +01:00
parent df8ca1ef84
commit 8784e5d043
4 changed files with 60 additions and 36 deletions

View File

@ -122,3 +122,36 @@ ALTER TABLE llx_societe ADD INDEX idx_societe_warehouse(fk_warehouse);
ALTER TABLE llx_socpeople MODIFY poste varchar(255);
ALTER TABLE llx_chargesociales ADD COLUMN fk_user integer DEFAULT NULL;
RENAME TABLE llx_payment_salary TO llx_salary;
RENAME TABLE llx_payment_salary_extrafields TO llx_salary_extrafields;
ALTER TABLE llx_salary RENAME INDEX idx_payment_salary_ref TO idx_salary_ref;
ALTER TABLE llx_salary RENAME INDEX idx_payment_salary_user TO idx_salary_user;
ALTER TABLE llx_salary RENAME INDEX idx_payment_salary_datep TO idx_salary_datep;
ALTER TABLE llx_salary RENAME INDEX idx_payment_salary_datesp TO idx_salary_datesp;
ALTER TABLE llx_salary RENAME INDEX idx_payment_salary_dateep TO idx_salary_dateep;
ALTER TABLE llx_salary DROP CONSTRAINT fk_payment_salary_user, ADD CONSTRAINT fk_salary_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid);
ALTER TABLE llx_salary_extrafields RENAME INDEX idx_payment_salary_extrafields TO idx_salary_extrafields;
ALTER TABLE llx_salary ADD paye smallint default 1 NOT NULL;
ALTER TABLE llx_salary ADD fk_account integer;
ALTER TABLE llx_salary ALTER COLUMN paye SET DEFAULT 0;
create table llx_payment_salary
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_salary integer,
datec datetime, -- date de creation
tms timestamp,
datep datetime, -- payment date
amount double(24,8) DEFAULT 0,
fk_typepaiement integer NOT NULL,
num_paiement varchar(50),
note text,
fk_bank integer NOT NULL,
fk_user_creat integer, -- creation user
fk_user_modif integer -- last modification user
)ENGINE=innodb;

View File

@ -25,7 +25,6 @@
* \ingroup salaries
* \brief Page of salaries payments
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
@ -493,6 +492,16 @@ if ($action == 'create')
print '<input name="amount" id="amount" class="minwidth100" value="'.GETPOST("amount").'">';
print '</td></tr>';
// Project
if (!empty($conf->projet->enabled))
{
$formproject = new FormProjets($db);
print '<tr><td>'.$langs->trans("Project").'</td><td>';
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
print '</td></tr>';
}
// Bank
if (!empty($conf->banque->enabled))
{
@ -503,9 +512,9 @@ if ($action == 'create')
}
// Type payment
print '<tr><td>';
print '<tr><td id="label_type_payment">';
print $form->editfieldkey('PaymentMode', 'selectpaymenttype', '', $object, 0, 'string', '', 1).'</td><td>';
$form->select_types_paiements(GETPOST("paymenttype", 'aZ09'), "paymenttype", '', 2);
$form->select_types_paiements(GETPOST("paymenttype", 'aZ09'), "paymenttype", '');
print '</td></tr>';
// Auto create payment
@ -513,13 +522,13 @@ if ($action == 'create')
print '<td><input id="auto_create_paiement" name="auto_create_paiement" type="checkbox" '.($_REQUEST['action'] === 'add' ? (empty($auto_create_paiement) ? '' : 'checked="checked"') : 'checked="checked"').' value="1"></td></tr>'."\n";
// Date payment
print '<tr><td>';
print '<tr class="hide_if_no_auto_create_payment"><td>';
print $form->editfieldkey('DatePayment', 'datep', '', $object, 0, 'string', '', 1).'</td><td>';
print $form->selectDate((empty($datep) ? '' : $datep), "datep", 0, 0, 0, 'add', 1, 1);
print '</td></tr>';
// Date value for bank
print '<tr><td>';
print '<tr class="hide_if_no_auto_create_payment"><td>';
print $form->editfieldkey('DateValue', 'datev', '', $object, 0).'</td><td>';
print $form->selectDate((empty($datev) ?-1 : $datev), "datev", '', '', '', 'add', 1, 1);
print '</td></tr>';
@ -534,16 +543,6 @@ if ($action == 'create')
print '<td><input name="num_payment" id="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
}
// Project
if (!empty($conf->projet->enabled))
{
$formproject = new FormProjets($db);
print '<tr><td>'.$langs->trans("Project").'</td><td>';
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
print '</td></tr>';
}
// Comments
print '<tr class="hide_if_no_auto_create_payment">';
print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
@ -646,7 +645,7 @@ if ($id)
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= $formproject->select_projects(-1, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref .= '</form>';
} else {

View File

@ -448,27 +448,16 @@ class Salary extends CommonObject
if ($this->id > 0)
{
if (!empty($conf->banque->enabled) && !empty($this->amount))
{
// Insert into llx_bank
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$acc = new Account($this->db);
$result = $acc->fetch($this->accountid);
if ($result <= 0) dol_print_error($this->db);
// Update extrafield
if (!$error) {
if (!$error)
// Update extrafield
if (!$error) {
if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)
{
$result = $this->insertExtraFields();
if ($result < 0)
{
$error++;
}
$error++;
}
}
}
// Call trigger

View File

@ -25,7 +25,7 @@
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
if (!empty($conf->accounting->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
@ -577,7 +577,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
}
}
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield';
// if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield';
// Amount
print '<td class="nowrap right">'.price($obj->amount).'</td>';
@ -589,6 +589,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
}
$totalarray['val']['totalttcfield'] += $obj->amount;
print '<td class="nowrap right">'.$salstatic->LibStatut($obj->paye, 5, $obj->alreadypayed).'</td>';
if (!$i) $totalarray['nbfield']++;
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook