FIX #16160
This commit is contained in:
parent
c9e232f2ff
commit
348fd0fcb5
@ -318,7 +318,7 @@ switch ($action)
|
|||||||
if ($invoice->total_ttc == $obj_facturation->amountWithTax()
|
if ($invoice->total_ttc == $obj_facturation->amountWithTax()
|
||||||
&& $obj_facturation->getSetPaymentMode() != 'DIFF')
|
&& $obj_facturation->getSetPaymentMode() != 'DIFF')
|
||||||
{
|
{
|
||||||
// We set status to payed
|
// We set status to paid
|
||||||
$result = $invoice->set_paid($user);
|
$result = $invoice->set_paid($user);
|
||||||
//print 'set paid';exit;
|
//print 'set paid';exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1051,7 +1051,7 @@ class Invoices extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->invoice->paye) {
|
if ($this->invoice->paye) {
|
||||||
throw new RestException(500, 'Alreay payed');
|
throw new RestException(500, 'Alreay paid');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->invoice->fetch($id);
|
$this->invoice->fetch($id);
|
||||||
|
|||||||
@ -1090,7 +1090,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unpayed supplier invoices
|
* Unpaid supplier invoices
|
||||||
*/
|
*/
|
||||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
|
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -381,7 +381,7 @@ class Localtax extends CommonObject
|
|||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* localtax payed
|
* Total of localtax paid in invoice
|
||||||
*
|
*
|
||||||
* @param int $year Year
|
* @param int $year Year
|
||||||
* @return int ???
|
* @return int ???
|
||||||
@ -419,8 +419,7 @@ class Localtax extends CommonObject
|
|||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* localtax payed
|
* Total of localtax paid
|
||||||
* Total de la localtax payed
|
|
||||||
*
|
*
|
||||||
* @param int $year Year
|
* @param int $year Year
|
||||||
* @return int ???
|
* @return int ???
|
||||||
|
|||||||
@ -565,7 +565,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Payed
|
* Paid
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print load_fiche_titre($langs->transcountry($LTPaid, $mysoc->country_code), '', '');
|
print load_fiche_titre($langs->transcountry($LTPaid, $mysoc->country_code), '', '');
|
||||||
|
|||||||
@ -162,7 +162,7 @@ print dol_get_fiche_end();
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* List of social contributions payed
|
* List of social contributions paid
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$disable_delete = 0;
|
$disable_delete = 0;
|
||||||
@ -213,7 +213,7 @@ if ($resql)
|
|||||||
print '<td class="right">'.price($objp->sc_amount).'</td>';
|
print '<td class="right">'.price($objp->sc_amount).'</td>';
|
||||||
// Status
|
// Status
|
||||||
print '<td class="center">'.$socialcontrib->getLibStatut(4, $objp->amount).'</td>';
|
print '<td class="center">'.$socialcontrib->getLibStatut(4, $objp->amount).'</td>';
|
||||||
// Amount payed
|
// Amount paid
|
||||||
print '<td class="right">'.price($objp->amount).'</td>';
|
print '<td class="right">'.price($objp->amount).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
if ($objp->paye == 1) // If at least one invoice is paid, disable delete
|
if ($objp->paye == 1) // If at least one invoice is paid, disable delete
|
||||||
|
|||||||
@ -370,7 +370,7 @@ class BonPrelevement extends CommonObject
|
|||||||
$num = count($facs);
|
$num = count($facs);
|
||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
/* Tag invoice as payed */
|
/* Tag invoice as paid */
|
||||||
dol_syslog(get_class($this)."::set_credite set_paid fac ".$facs[$i]);
|
dol_syslog(get_class($this)."::set_credite set_paid fac ".$facs[$i]);
|
||||||
$fac = new Facture($this->db);
|
$fac = new Facture($this->db);
|
||||||
$fac->fetch($facs[$i]);
|
$fac->fetch($facs[$i]);
|
||||||
|
|||||||
@ -421,7 +421,7 @@ class ChargeSociales extends CommonObject
|
|||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Tag social contribution as payed completely
|
* Tag social contribution as paid completely
|
||||||
*
|
*
|
||||||
* @param User $user Object user making change
|
* @param User $user Object user making change
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
@ -439,7 +439,7 @@ class ChargeSociales extends CommonObject
|
|||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Remove tag payed on social contribution
|
* Remove tag paid on social contribution
|
||||||
*
|
*
|
||||||
* @param User $user Object user making change
|
* @param User $user Object user making change
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
@ -459,7 +459,7 @@ class ChargeSociales extends CommonObject
|
|||||||
* Retourne le libelle du statut d'une charge (impaye, payee)
|
* Retourne le libelle du statut d'une charge (impaye, payee)
|
||||||
*
|
*
|
||||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
|
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
|
||||||
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount paid if you have it, 1 otherwise)
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
public function getLibStatut($mode = 0, $alreadypaid = -1)
|
public function getLibStatut($mode = 0, $alreadypaid = -1)
|
||||||
@ -473,7 +473,7 @@ class ChargeSociales extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param int $status Id status
|
* @param int $status Id status
|
||||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
|
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
|
||||||
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount paid if you have it, 1 otherwise)
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
public function LibStatut($status, $mode = 0, $alreadypaid = -1)
|
public function LibStatut($status, $mode = 0, $alreadypaid = -1)
|
||||||
|
|||||||
@ -110,7 +110,7 @@ class PaymentSocialContribution extends CommonObject
|
|||||||
* Use this->amounts to have list of lines for the payment
|
* Use this->amounts to have list of lines for the payment
|
||||||
*
|
*
|
||||||
* @param User $user User making payment
|
* @param User $user User making payment
|
||||||
* @param int $closepaidcontrib 1=Also close payed contributions to paid, 0=Do nothing more
|
* @param int $closepaidcontrib 1=Also close paid contributions to paid, 0=Do nothing more
|
||||||
* @return int <0 if KO, id of payment if OK
|
* @return int <0 if KO, id of payment if OK
|
||||||
*/
|
*/
|
||||||
public function create($user, $closepaidcontrib = 0)
|
public function create($user, $closepaidcontrib = 0)
|
||||||
@ -178,7 +178,7 @@ class PaymentSocialContribution extends CommonObject
|
|||||||
{
|
{
|
||||||
$amount = price2num($amount);
|
$amount = price2num($amount);
|
||||||
|
|
||||||
// If we want to closed payed invoices
|
// If we want to closed paid invoices
|
||||||
if ($closepaidcontrib)
|
if ($closepaidcontrib)
|
||||||
{
|
{
|
||||||
$contrib = new ChargeSociales($this->db);
|
$contrib = new ChargeSociales($this->db);
|
||||||
|
|||||||
@ -413,7 +413,7 @@ class Tva extends CommonObject
|
|||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* VAT payed
|
* Total of VAT paid into invoice
|
||||||
*
|
*
|
||||||
* @param int $year Year
|
* @param int $year Year
|
||||||
* @return double Amount
|
* @return double Amount
|
||||||
@ -451,7 +451,7 @@ class Tva extends CommonObject
|
|||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Total of the VAT payed
|
* Total of the VAT paid
|
||||||
*
|
*
|
||||||
* @param int $year Year
|
* @param int $year Year
|
||||||
* @return double Amount
|
* @return double Amount
|
||||||
|
|||||||
@ -543,7 +543,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Payed
|
* Paid
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("VATPaid"), '', '');
|
print load_fiche_titre($langs->trans("VATPaid"), '', '');
|
||||||
|
|||||||
@ -26,7 +26,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to manage the box to show not payed suppliers invoices
|
* Class to manage the box to show not paid suppliers invoices
|
||||||
*/
|
*/
|
||||||
class box_factures_fourn_imp extends ModeleBoxes
|
class box_factures_fourn_imp extends ModeleBoxes
|
||||||
{
|
{
|
||||||
|
|||||||
@ -748,7 +748,7 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
|||||||
$pdf->SetFont('', '', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||||
|
|
||||||
// Payed
|
// Paid
|
||||||
$thirdparty = $object->thirdparty;
|
$thirdparty = $object->thirdparty;
|
||||||
|
|
||||||
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||||
|
|||||||
@ -184,7 +184,7 @@ if ($resql)
|
|||||||
print '<td class="right">'.price($objp->d_amount).'</td>';
|
print '<td class="right">'.price($objp->d_amount).'</td>';
|
||||||
// Status
|
// Status
|
||||||
print '<td class="center">'.$don->getLibStatut(4, $objp->amount).'</td>';
|
print '<td class="center">'.$don->getLibStatut(4, $objp->amount).'</td>';
|
||||||
// Amount payed
|
// Amount paid
|
||||||
print '<td class="right">'.price($objp->amount).'</td>';
|
print '<td class="right">'.price($objp->amount).'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
if ($objp->paid == 1) {
|
if ($objp->paid == 1) {
|
||||||
|
|||||||
@ -66,14 +66,14 @@ class ExpenseReport extends CommonObject
|
|||||||
public $date_fin;
|
public $date_fin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied
|
* 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=paid, 99=denied
|
||||||
*
|
*
|
||||||
* @var int Status
|
* @var int Status
|
||||||
*/
|
*/
|
||||||
public $status;
|
public $status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied
|
* 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=paid, 99=denied
|
||||||
*
|
*
|
||||||
* @var int Status
|
* @var int Status
|
||||||
* @deprecated
|
* @deprecated
|
||||||
|
|||||||
@ -1248,7 +1248,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Tag invoice as a payed invoice
|
* Tag invoice as a paid invoice
|
||||||
*
|
*
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param string $close_code Code indicates whether the class has paid in full while payment is incomplete. Not implementd yet.
|
* @param string $close_code Code indicates whether the class has paid in full while payment is incomplete. Not implementd yet.
|
||||||
|
|||||||
@ -229,7 +229,7 @@ class PaiementFourn extends Paiement
|
|||||||
$invoice = new FactureFournisseur($this->db);
|
$invoice = new FactureFournisseur($this->db);
|
||||||
$invoice->fetch($facid);
|
$invoice->fetch($facid);
|
||||||
|
|
||||||
// If we want to closed payed invoices
|
// If we want to closed paid invoices
|
||||||
if ($closepaidinvoices)
|
if ($closepaidinvoices)
|
||||||
{
|
{
|
||||||
$paiement = $invoice->getSommePaiement();
|
$paiement = $invoice->getSommePaiement();
|
||||||
|
|||||||
@ -489,7 +489,7 @@ if (empty($reshook))
|
|||||||
$result = $discountcheck->fetch(0, 0, $object->id);
|
$result = $discountcheck->fetch(0, 0, $object->id);
|
||||||
|
|
||||||
$canconvert = 0;
|
$canconvert = 0;
|
||||||
if ($object->type == FactureFournisseur::TYPE_DEPOSIT && empty($discountcheck->id)) $canconvert = 1; // we can convert deposit into discount if deposit is payed (completely, partially or not at all) and not already converted (see real condition into condition used to show button converttoreduc)
|
if ($object->type == FactureFournisseur::TYPE_DEPOSIT && empty($discountcheck->id)) $canconvert = 1; // we can convert deposit into discount if deposit is paid (completely, partially or not at all) and not already converted (see real condition into condition used to show button converttoreduc)
|
||||||
if (($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_STANDARD) && $object->paye == 0 && empty($discountcheck->id)) $canconvert = 1; // we can convert credit note into discount if credit note is not refunded completely and not already converted and amount of payment is 0 (see also the real condition used as the condition to show button converttoreduc)
|
if (($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_STANDARD) && $object->paye == 0 && empty($discountcheck->id)) $canconvert = 1; // we can convert credit note into discount if credit note is not refunded completely and not already converted and amount of payment is 0 (see also the real condition used as the condition to show button converttoreduc)
|
||||||
if ($canconvert)
|
if ($canconvert)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -511,7 +511,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* All unpayed supplier invoices
|
* All unpaid supplier invoices
|
||||||
*/
|
*/
|
||||||
$sql = 'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.type, f.total_ht, f.total_ttc,';
|
$sql = 'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.type, f.total_ht, f.total_ttc,';
|
||||||
$sql .= ' f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc,';
|
$sql .= ' f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc,';
|
||||||
|
|||||||
@ -305,7 +305,7 @@ if ($result > 0)
|
|||||||
print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'), 'company').' '.$objp->name.'</a></td>';
|
print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'), 'company').' '.$objp->name.'</a></td>';
|
||||||
// Expected to pay
|
// Expected to pay
|
||||||
print '<td class="right">'.price($objp->total_ttc).'</td>';
|
print '<td class="right">'.price($objp->total_ttc).'</td>';
|
||||||
// Payed
|
// Paid
|
||||||
print '<td class="right">'.price($objp->amount).'</td>';
|
print '<td class="right">'.price($objp->amount).'</td>';
|
||||||
// Status
|
// Status
|
||||||
print '<td class="right">'.$facturestatic->LibStatut($objp->paye, $objp->status, 6, 1).'</td>';
|
print '<td class="right">'.$facturestatic->LibStatut($objp->paye, $objp->status, 6, 1).'</td>';
|
||||||
|
|||||||
@ -101,7 +101,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
|
|||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAYED','Expense report billed','Executed when an expense report is set as billed','expensereport',204);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',211);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',211);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',212);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',212);
|
||||||
|
|||||||
@ -563,3 +563,6 @@ INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES
|
|||||||
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64);
|
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64);
|
||||||
|
|
||||||
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;
|
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE llx_c_action_trigger SET code = 'EXPENSE_REPORT_PAID' where code = 'EXPENSE_REPORT_PAYED';
|
||||||
|
|||||||
@ -248,7 +248,7 @@ CREATE TABLE llx_expensereport (
|
|||||||
fk_user_approve integer DEFAULT NULL,
|
fk_user_approve integer DEFAULT NULL,
|
||||||
fk_user_refuse integer DEFAULT NULL,
|
fk_user_refuse integer DEFAULT NULL,
|
||||||
fk_user_cancel integer DEFAULT NULL,
|
fk_user_cancel integer DEFAULT NULL,
|
||||||
fk_statut integer NOT NULL, -- 1=brouillon, 2=validé (attente approb), 4=annulé, 5=approuvé, 6=payed, 99=refusé
|
fk_statut integer NOT NULL, -- 1=draft, 2=validate (waiting approbation), 4=cancel, 5=approved, 6=paid, 99=refused
|
||||||
fk_c_paiement integer DEFAULT NULL,
|
fk_c_paiement integer DEFAULT NULL,
|
||||||
paid smallint DEFAULT 0 NOT NULL,
|
paid smallint DEFAULT 0 NOT NULL,
|
||||||
note_public text,
|
note_public text,
|
||||||
@ -524,13 +524,13 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
|
|||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_PAYED','Customer invoice paid','Executed when a customer invoice is paid','facture',7);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_PAYED','Supplier invoice paid','Executed when a supplier invoice is paid','invoice_supplier',16);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20);
|
||||||
|
|||||||
@ -509,7 +509,7 @@ UPDATE llx_facturedet SET situation_percent = 100 WHERE situation_percent IS NUL
|
|||||||
-- from llx_facturedet as fd, llx_facture as f where fd.fk_facture = f.rowid AND (total_ht - situation_percent / 100 * subprice * qty * (1 - (fd.remise_percent / 100))) > 0.01 and f.type = 5;
|
-- from llx_facturedet as fd, llx_facture as f where fd.fk_facture = f.rowid AND (total_ht - situation_percent / 100 * subprice * qty * (1 - (fd.remise_percent / 100))) > 0.01 and f.type = 5;
|
||||||
|
|
||||||
|
|
||||||
-- Note to make all deposit as payed when there is already a discount generated from it.
|
-- Note to make all deposit as paid when there is already a discount generated from it.
|
||||||
--drop table tmp_invoice_deposit_mark_as_available;
|
--drop table tmp_invoice_deposit_mark_as_available;
|
||||||
--create table tmp_invoice_deposit_mark_as_available as select * from llx_facture as f where f.type = 3 and f.paye = 0 and f.rowid in (select fk_facture_source from llx_societe_remise_except);
|
--create table tmp_invoice_deposit_mark_as_available as select * from llx_facture as f where f.type = 3 and f.paye = 0 and f.rowid in (select fk_facture_source from llx_societe_remise_except);
|
||||||
--update llx_facture set paye = 1, fk_statut = 2 where rowid in (select rowid from tmp_invoice_deposit_mark_as_available);
|
--update llx_facture set paye = 1, fk_statut = 2 where rowid in (select rowid from tmp_invoice_deposit_mark_as_available);
|
||||||
|
|||||||
@ -43,7 +43,7 @@ CREATE TABLE llx_expensereport (
|
|||||||
fk_user_approve integer DEFAULT NULL,
|
fk_user_approve integer DEFAULT NULL,
|
||||||
fk_user_refuse integer DEFAULT NULL,
|
fk_user_refuse integer DEFAULT NULL,
|
||||||
fk_user_cancel integer DEFAULT NULL,
|
fk_user_cancel integer DEFAULT NULL,
|
||||||
fk_statut integer NOT NULL, -- 1=brouillon, 2=validated (waiting approval), 4=canceled, 5=approved, 6=payed, 99=refused
|
fk_statut integer NOT NULL, -- 1=brouillon, 2=validated (waiting approval), 4=canceled, 5=approved, 6=paid, 99=refused
|
||||||
fk_c_paiement integer DEFAULT NULL, -- deprecated
|
fk_c_paiement integer DEFAULT NULL, -- deprecated
|
||||||
paid smallint default 0 NOT NULL, -- deprecated (status is used instead)
|
paid smallint default 0 NOT NULL, -- deprecated (status is used instead)
|
||||||
note_public text,
|
note_public text,
|
||||||
|
|||||||
@ -377,7 +377,7 @@ class Loan extends CommonObject
|
|||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Tag loan as payed completely
|
* Tag loan as paid completely
|
||||||
*
|
*
|
||||||
* @param User $user Object user making change
|
* @param User $user Object user making change
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
@ -445,7 +445,7 @@ class Loan extends CommonObject
|
|||||||
* Return label of loan status (unpaid, paid)
|
* Return label of loan status (unpaid, paid)
|
||||||
*
|
*
|
||||||
* @param int $mode 0=label, 1=short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label
|
* @param int $mode 0=label, 1=short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label
|
||||||
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount paid if you have it, 1 otherwise)
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
public function getLibStatut($mode = 0, $alreadypaid = -1)
|
public function getLibStatut($mode = 0, $alreadypaid = -1)
|
||||||
@ -459,7 +459,7 @@ class Loan extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param int $status Id status
|
* @param int $status Id status
|
||||||
* @param int $mode 0=Label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label, 5=Short label + Picto
|
* @param int $mode 0=Label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label, 5=Short label + Picto
|
||||||
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount paid if you have it, 1 otherwise)
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
public function LibStatut($status, $mode = 0, $alreadypaid = -1)
|
public function LibStatut($status, $mode = 0, $alreadypaid = -1)
|
||||||
|
|||||||
@ -93,7 +93,7 @@ $help_url = '';
|
|||||||
$title = $langs->trans('Loans');
|
$title = $langs->trans('Loans');
|
||||||
|
|
||||||
$sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.paid,";
|
$sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.paid,";
|
||||||
$sql .= " SUM(pl.amount_capital) as alreadypayed";
|
$sql .= " SUM(pl.amount_capital) as alreadypaid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."loan as l LEFT JOIN ".MAIN_DB_PREFIX."payment_loan AS pl";
|
$sql .= " FROM ".MAIN_DB_PREFIX."loan as l LEFT JOIN ".MAIN_DB_PREFIX."payment_loan AS pl";
|
||||||
$sql .= " ON l.rowid = pl.fk_loan";
|
$sql .= " ON l.rowid = pl.fk_loan";
|
||||||
$sql .= " WHERE l.entity = ".$conf->entity;
|
$sql .= " WHERE l.entity = ".$conf->entity;
|
||||||
@ -229,7 +229,7 @@ if ($resql)
|
|||||||
print '<td class="center width100">'.dol_print_date($db->jdate($obj->dateend), 'day').'</td>';
|
print '<td class="center width100">'.dol_print_date($db->jdate($obj->dateend), 'day').'</td>';
|
||||||
|
|
||||||
print '<td class="right nowrap">';
|
print '<td class="right nowrap">';
|
||||||
print $loan_static->LibStatut($obj->paid, 5, $obj->alreadypayed);
|
print $loan_static->LibStatut($obj->paid, 5, $obj->alreadypaid);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
|||||||
@ -149,7 +149,7 @@ print '</div>';
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* List of loans payed
|
* List of loans paid
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$disable_delete = 0;
|
$disable_delete = 0;
|
||||||
@ -194,7 +194,7 @@ if ($resql)
|
|||||||
// print '<td class="right">'.price($objp->capital).'</td>';
|
// print '<td class="right">'.price($objp->capital).'</td>';
|
||||||
// Status
|
// Status
|
||||||
print '<td class="center">'.$loan->getLibStatut(4, $objp->amount_capital).'</td>';
|
print '<td class="center">'.$loan->getLibStatut(4, $objp->amount_capital).'</td>';
|
||||||
// Amount payed
|
// Amount paid
|
||||||
$amount_payed = $objp->amount_capital + $objp->amount_insurance + $objp->amount_interest;
|
$amount_payed = $objp->amount_capital + $objp->amount_insurance + $objp->amount_interest;
|
||||||
|
|
||||||
print '<td class="right">'.price($amount_payed).'</td>';
|
print '<td class="right">'.price($amount_payed).'</td>';
|
||||||
|
|||||||
@ -1855,7 +1855,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
|
|||||||
{
|
{
|
||||||
$noidempotency_key = (GETPOSTISSET('noidempotency') ? GETPOST('noidempotency', 'int') : 0); // By default noidempotency is unset, so we must use a different tag/ref for each payment. If set, we can pay several times the same tag/ref.
|
$noidempotency_key = (GETPOSTISSET('noidempotency') ? GETPOST('noidempotency', 'int') : 0); // By default noidempotency is unset, so we must use a different tag/ref for each payment. If set, we can pay several times the same tag/ref.
|
||||||
$paymentintent = $stripe->getPaymentIntent($amount, $currency, $tag, 'Stripe payment: '.$fulltag.(is_object($object) ? ' ref='.$object->ref : ''), $object, $stripecu, $stripeacc, $servicestatus, 0, 'automatic', false, null, 0, $noidempotency_key);
|
$paymentintent = $stripe->getPaymentIntent($amount, $currency, $tag, 'Stripe payment: '.$fulltag.(is_object($object) ? ' ref='.$object->ref : ''), $object, $stripecu, $stripeacc, $servicestatus, 0, 'automatic', false, null, 0, $noidempotency_key);
|
||||||
// The paymentintnent has status 'requires_payment_method' (even if paymentintent was already payed)
|
// The paymentintnent has status 'requires_payment_method' (even if paymentintent was already paid)
|
||||||
//var_dump($paymentintent);
|
//var_dump($paymentintent);
|
||||||
if ($stripe->error) setEventMessages($stripe->error, null, 'errors');
|
if ($stripe->error) setEventMessages($stripe->error, null, 'errors');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -614,7 +614,7 @@ if ($ispaymentok)
|
|||||||
$ispostactionok = -1;
|
$ispostactionok = -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$postactionmessages[] = 'Member '.$tmptag['MEM'].' for subscription payed was not found';
|
$postactionmessages[] = 'Member '.$tmptag['MEM'].' for subscription paid was not found';
|
||||||
$ispostactionok = -1;
|
$ispostactionok = -1;
|
||||||
}
|
}
|
||||||
} elseif (array_key_exists('INV', $tmptag) && $tmptag['INV'] > 0)
|
} elseif (array_key_exists('INV', $tmptag) && $tmptag['INV'] > 0)
|
||||||
@ -718,7 +718,7 @@ if ($ispaymentok)
|
|||||||
$ispostactionok = -1;
|
$ispostactionok = -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$postactionmessages[] = 'Invoice payed '.$tmptag['INV'].' was not found';
|
$postactionmessages[] = 'Invoice paid '.$tmptag['INV'].' was not found';
|
||||||
$ispostactionok = -1;
|
$ispostactionok = -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1068,7 +1068,7 @@ class Thirdparties extends DolibarrApi
|
|||||||
/**
|
/**
|
||||||
* Return list of invoices qualified to be corrected by a credit note.
|
* Return list of invoices qualified to be corrected by a credit note.
|
||||||
* Invoices matching the following rules are returned
|
* Invoices matching the following rules are returned
|
||||||
* (validated + payment on process) or classified (payed completely or payed partialy) + not already replaced + not already a credit note
|
* (validated + payment on process) or classified (paid completely or paid partialy) + not already replaced + not already a credit note
|
||||||
*
|
*
|
||||||
* @param int $id Id of thirdparty
|
* @param int $id Id of thirdparty
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user