02-05-2021, 03:11 PM
SalesOrder_StatusOnInvoiceSave is resolve, the module of the list to select must be invoice.
Now it works correctly.
But for CobroPago_Invoice_Status_OnPaid, I tried several modules, but could not find the correct one.
Even hardcoded code invoice.php, but when I add payments it still doesn't change the invoice status to Paid
if ($amountDue<=0) {
$newStatus = GlobalVariable::getVariable('CobroPago_Invoice_Status_OnPaid', 'Paid');
if ($newStatus!='DoNotChange') {
$query = "update vtiger_invoice set invoicestatus='{$newStatus}' where invoiceid={$invoiceId}";
$adb->query($query);
if ($context=='Invoice') {
$column_fields['invoicestatus'] = $newStatus;
}
}
}
Now it works correctly.
But for CobroPago_Invoice_Status_OnPaid, I tried several modules, but could not find the correct one.
Even hardcoded code invoice.php, but when I add payments it still doesn't change the invoice status to Paid
if ($amountDue<=0) {
$newStatus = GlobalVariable::getVariable('CobroPago_Invoice_Status_OnPaid', 'Paid');
if ($newStatus!='DoNotChange') {
$query = "update vtiger_invoice set invoicestatus='{$newStatus}' where invoiceid={$invoiceId}";
$adb->query($query);
if ($context=='Invoice') {
$column_fields['invoicestatus'] = $newStatus;
}
}
}