FIX setup of suggested payment mode on proposals and orders
This commit is contained in:
parent
26022f062f
commit
855ac5467c
@ -192,7 +192,8 @@ elseif ($action == 'set_ORDER_FREE_TEXT')
|
|||||||
{
|
{
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
} elseif ($action == "setshippableiconinlist") {
|
}
|
||||||
|
elseif ($action == "setshippableiconinlist") {
|
||||||
// Activate Set Shippable Icon In List
|
// Activate Set Shippable Icon In List
|
||||||
$setshippableiconinlist = GETPOST('value', 'int');
|
$setshippableiconinlist = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity);
|
||||||
@ -203,6 +204,25 @@ elseif ($action == 'set_ORDER_FREE_TEXT')
|
|||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elseif ($action == 'setribchq')
|
||||||
|
{
|
||||||
|
$rib = GETPOST('rib', 'alpha');
|
||||||
|
$chq = GETPOST('chq', 'alpha');
|
||||||
|
|
||||||
|
$res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity);
|
||||||
|
$res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
if (!$res > 0) $error++;
|
||||||
|
|
||||||
|
if (!$error)
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Activate ask for payment bank
|
// Activate ask for payment bank
|
||||||
elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
|
elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
|
||||||
@ -514,7 +534,122 @@ foreach ($dirmodels as $reldir)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print "<br>";
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Payment mode
|
||||||
|
*/
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInOrder"), '', '');
|
||||||
|
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||||
|
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>';
|
||||||
|
print '<input type="hidden" name="action" value="setribchq">';
|
||||||
|
print $langs->trans("PaymentMode").'</td>';
|
||||||
|
print '<td align="right">';
|
||||||
|
if (empty($conf->facture->enabled)) {
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
|
||||||
|
print "<td>";
|
||||||
|
if (empty($conf->facture->enabled))
|
||||||
|
{
|
||||||
|
if (!empty($conf->banque->enabled))
|
||||||
|
{
|
||||||
|
$sql = "SELECT rowid, label";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||||
|
$sql .= " WHERE clos = 0";
|
||||||
|
$sql .= " AND courant = 1";
|
||||||
|
$sql .= " AND entity IN (".getEntity('bank_account').")";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
if ($num > 0)
|
||||||
|
{
|
||||||
|
print '<select name="rib" class="flat" id="rib">';
|
||||||
|
print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$row = $db->fetch_row($resql);
|
||||||
|
|
||||||
|
print '<option value="'.$row[0].'"';
|
||||||
|
print $conf->global->FACTURE_RIB_NUMBER == $row[0] ? ' selected' : '';
|
||||||
|
print '>'.$row[1].'</option>';
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
print "</select>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<i>".$langs->trans("NoActiveBankAccountDefined")."</i>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("BankModuleNotActive").'</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
|
||||||
|
}
|
||||||
|
print "</td></tr>";
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print "<td>".$langs->trans("SuggestPaymentByChequeToAddress")."</td>";
|
||||||
|
print "<td>";
|
||||||
|
if (empty($conf->facture->enabled))
|
||||||
|
{
|
||||||
|
print '<select class="flat" name="chq" id="chq">';
|
||||||
|
print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
|
||||||
|
print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER ? ' selected' : '').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name ? $mysoc->name : $langs->trans("NotDefined")).')</option>';
|
||||||
|
|
||||||
|
$sql = "SELECT rowid, label";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||||
|
$sql .= " WHERE clos = 0";
|
||||||
|
$sql .= " AND courant = 1";
|
||||||
|
$sql .= " AND entity IN (".getEntity('bank_account').")";
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$row = $db->fetch_row($resql);
|
||||||
|
|
||||||
|
print '<option value="'.$row[0].'"';
|
||||||
|
print $conf->global->FACTURE_CHQ_NUMBER == $row[0] ? ' selected' : '';
|
||||||
|
print '>'.$langs->trans("OwnerOfBankAccount", $row[1]).'</option>';
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</select>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
|
||||||
|
}
|
||||||
|
print "</td></tr>";
|
||||||
|
print "</table>";
|
||||||
|
print "</form>";
|
||||||
|
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Other options
|
* Other options
|
||||||
|
|||||||
@ -640,7 +640,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Modes de reglement
|
* Payment modes
|
||||||
*/
|
*/
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"), '', '');
|
print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"), '', '');
|
||||||
|
|||||||
@ -512,29 +512,35 @@ foreach ($dirmodels as $reldir)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Payment mode
|
* Payment mode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInProposal"), '', '');
|
||||||
|
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||||
|
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>';
|
||||||
|
print '<input type="hidden" name="action" value="setribchq">';
|
||||||
|
print $langs->trans("PaymentMode").'</td>';
|
||||||
|
print '<td align="right">';
|
||||||
|
if (empty($conf->facture->enabled)) {
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
|
||||||
|
print "<td>";
|
||||||
if (empty($conf->facture->enabled))
|
if (empty($conf->facture->enabled))
|
||||||
{
|
{
|
||||||
print '<br>';
|
|
||||||
print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInProposal"), '', '');
|
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td>';
|
|
||||||
print '<input type="hidden" name="action" value="setribchq">';
|
|
||||||
print $langs->trans("PaymentMode").'</td>';
|
|
||||||
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
|
||||||
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
|
|
||||||
print "<td>";
|
|
||||||
if (!empty($conf->banque->enabled))
|
if (!empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
$sql = "SELECT rowid, label";
|
$sql = "SELECT rowid, label";
|
||||||
@ -571,13 +577,19 @@ if (empty($conf->facture->enabled))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("BankModuleNotActive");
|
print '<span class="opacitymedium">'.$langs->trans("BankModuleNotActive").'</span>';
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
}
|
||||||
|
else {
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
|
||||||
|
}
|
||||||
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print "<td>".$langs->trans("SuggestPaymentByChequeToAddress")."</td>";
|
print "<td>".$langs->trans("SuggestPaymentByChequeToAddress")."</td>";
|
||||||
print "<td>";
|
print "<td>";
|
||||||
|
if (empty($conf->facture->enabled))
|
||||||
|
{
|
||||||
print '<select class="flat" name="chq" id="chq">';
|
print '<select class="flat" name="chq" id="chq">';
|
||||||
print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
|
print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
|
||||||
print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER ? ' selected' : '').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name ? $mysoc->name : $langs->trans("NotDefined")).')</option>';
|
print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER ? ' selected' : '').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name ? $mysoc->name : $langs->trans("NotDefined")).')</option>';
|
||||||
@ -605,10 +617,14 @@ if (empty($conf->facture->enabled))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</select>";
|
print "</select>";
|
||||||
print "</td></tr>";
|
|
||||||
print "</table>";
|
|
||||||
print "</form>";
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
|
||||||
|
}
|
||||||
|
print "</td></tr>";
|
||||||
|
print "</table>";
|
||||||
|
print "</form>";
|
||||||
|
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|||||||
@ -212,6 +212,7 @@ CompatibleUpTo=Compatible with version %s
|
|||||||
NotCompatible=This module does not seem compatible with your Dolibarr %s (Min %s - Max %s).
|
NotCompatible=This module does not seem compatible with your Dolibarr %s (Min %s - Max %s).
|
||||||
CompatibleAfterUpdate=This module requires an update to your Dolibarr %s (Min %s - Max %s).
|
CompatibleAfterUpdate=This module requires an update to your Dolibarr %s (Min %s - Max %s).
|
||||||
SeeInMarkerPlace=See in Market place
|
SeeInMarkerPlace=See in Market place
|
||||||
|
SeeSetupOfModule=See setup of module %s
|
||||||
Updated=Updated
|
Updated=Updated
|
||||||
Nouveauté=Novelty
|
Nouveauté=Novelty
|
||||||
AchatTelechargement=Buy / Download
|
AchatTelechargement=Buy / Download
|
||||||
@ -1296,7 +1297,7 @@ BillsPDFModules=Invoice documents models
|
|||||||
BillsPDFModulesAccordindToInvoiceType=Invoice documents models according to invoice type
|
BillsPDFModulesAccordindToInvoiceType=Invoice documents models according to invoice type
|
||||||
PaymentsPDFModules=Payment documents models
|
PaymentsPDFModules=Payment documents models
|
||||||
ForceInvoiceDate=Force invoice date to validation date
|
ForceInvoiceDate=Force invoice date to validation date
|
||||||
SuggestedPaymentModesIfNotDefinedInInvoice=Suggested payments mode on invoice by default if not defined for invoice
|
SuggestedPaymentModesIfNotDefinedInInvoice=Suggested payments mode on invoice by default if not defined on the invoice
|
||||||
SuggestPaymentByRIBOnAccount=Suggest payment by withdrawal on account
|
SuggestPaymentByRIBOnAccount=Suggest payment by withdrawal on account
|
||||||
SuggestPaymentByChequeToAddress=Suggest payment by check to
|
SuggestPaymentByChequeToAddress=Suggest payment by check to
|
||||||
FreeLegalTextOnInvoices=Free text on invoices
|
FreeLegalTextOnInvoices=Free text on invoices
|
||||||
@ -1308,7 +1309,7 @@ SupplierPaymentSetup=Vendor payments setup
|
|||||||
PropalSetup=Commercial proposals module setup
|
PropalSetup=Commercial proposals module setup
|
||||||
ProposalsNumberingModules=Commercial proposal numbering models
|
ProposalsNumberingModules=Commercial proposal numbering models
|
||||||
ProposalsPDFModules=Commercial proposal documents models
|
ProposalsPDFModules=Commercial proposal documents models
|
||||||
SuggestedPaymentModesIfNotDefinedInProposal=Suggested payments mode on proposal by default if not defined for proposal
|
SuggestedPaymentModesIfNotDefinedInProposal=Suggested payments mode on proposal by default if not defined on the proposal
|
||||||
FreeLegalTextOnProposal=Free text on commercial proposals
|
FreeLegalTextOnProposal=Free text on commercial proposals
|
||||||
WatermarkOnDraftProposal=Watermark on draft commercial proposals (none if empty)
|
WatermarkOnDraftProposal=Watermark on draft commercial proposals (none if empty)
|
||||||
BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL=Ask for bank account destination of proposal
|
BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL=Ask for bank account destination of proposal
|
||||||
@ -1323,6 +1324,7 @@ WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER=Ask for Warehouse Source for order
|
|||||||
##### Suppliers Orders #####
|
##### Suppliers Orders #####
|
||||||
BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER=Ask for bank account destination of purchase order
|
BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER=Ask for bank account destination of purchase order
|
||||||
##### Orders #####
|
##### Orders #####
|
||||||
|
SuggestedPaymentModesIfNotDefinedInOrder=Suggested payments mode on sale order by default if not defined on the order
|
||||||
OrdersSetup=Sales Orders management setup
|
OrdersSetup=Sales Orders management setup
|
||||||
OrdersNumberingModules=Orders numbering models
|
OrdersNumberingModules=Orders numbering models
|
||||||
OrdersModelModule=Order documents models
|
OrdersModelModule=Order documents models
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user