diff --git a/dev/resources/iso-normes/Accountancy-format_Ebp_txt.pdf b/dev/resources/iso-normes/Accountancy-format_Ebp_txt.pdf new file mode 100644 index 00000000000..24e6fca05e9 Binary files /dev/null and b/dev/resources/iso-normes/Accountancy-format_Ebp_txt.pdf differ diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 01f02a8a80a..90b722d7959 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; class AccountancyExport { /** - * @var Type of export. Defined by $conf->global->ACCOUNTING_EXPORT_MODELCSV + * Type of export. Defined by $conf->global->ACCOUNTING_EXPORT_MODELCSV */ public static $EXPORT_TYPE_NORMAL = 1; // CSV public static $EXPORT_TYPE_CONFIGURABLE = 10; // CSV @@ -535,14 +535,18 @@ class AccountancyExport print $line->id . $separator; print $date . $separator; print $line->code_journal . $separator; - print length_accountg($line->numero_compte) . $separator; - print substr(length_accountg($line->numero_compte), 0, 2) . $separator; + if (empty($line->subledger_account)) { + print $line->numero_compte . $separator; + } else { + print $line->subledger_account . $separator; + } + //print substr(length_accountg($line->numero_compte), 0, 2) . $separator; print '"'.dol_trunc($line->label_operation, 40, 'right', 'UTF-8', 1).'"' . $separator; print '"'.dol_trunc($line->piece_num, 15, 'right', 'UTF-8', 1).'"'.$separator; print price2num($line->montant).$separator; print $line->sens.$separator; print $date . $separator; - print 'EUR'; + //print 'EUR'; print $end_line; } } diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 3312b44aba2..e1d65250b6d 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -78,7 +78,7 @@ if ($action == 'updateMask') } } -if ($action == 'specimen') +else if ($action == 'specimen') { $modele=GETPOST('module', 'alpha'); @@ -164,7 +164,7 @@ elseif ($action == 'setmod') dolibarr_set_const($db, "FACTURE_ADDON", $value, 'chaine', 0, '', $conf->entity); } -if ($action == 'setribchq') +else if ($action == 'setribchq') { $rib = GETPOST('rib', 'alpha'); $chq = GETPOST('chq', 'alpha'); @@ -184,7 +184,7 @@ if ($action == 'setribchq') } } -if ($action == 'set_FACTURE_DRAFT_WATERMARK') +else if ($action == 'set_FACTURE_DRAFT_WATERMARK') { $draft = GETPOST('FACTURE_DRAFT_WATERMARK', 'alpha'); @@ -202,7 +202,7 @@ if ($action == 'set_FACTURE_DRAFT_WATERMARK') } } -if ($action == 'set_INVOICE_FREE_TEXT') +else if ($action == 'set_INVOICE_FREE_TEXT') { $freetext = GETPOST('INVOICE_FREE_TEXT', 'none'); // No alpha here, we want exact string @@ -220,7 +220,7 @@ if ($action == 'set_INVOICE_FREE_TEXT') } } -if ($action == 'setforcedate') +else if ($action == 'setforcedate') { $forcedate = GETPOST('forcedate', 'alpha'); @@ -238,7 +238,7 @@ if ($action == 'setforcedate') } } -if ($action == 'setDefaultPDFModulesByType') +else if ($action == 'setDefaultPDFModulesByType') { $invoicetypemodels = GETPOST('invoicetypemodels'); diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 9442d449974..e9a037b98c9 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -70,7 +70,7 @@ if ($action == 'updateMask') } } -if ($action == 'specimen') +else if ($action == 'specimen') { $modele=GETPOST('module', 'alpha'); @@ -115,7 +115,27 @@ if ($action == 'specimen') } } -if ($action == 'set_PROPALE_DRAFT_WATERMARK') +else if ($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'); + } +} + +else if ($action == 'set_PROPALE_DRAFT_WATERMARK') { $draft = GETPOST('PROPALE_DRAFT_WATERMARK', 'alpha'); @@ -132,7 +152,7 @@ if ($action == 'set_PROPALE_DRAFT_WATERMARK') } } -if ($action == 'set_PROPOSAL_FREE_TEXT') +else if ($action == 'set_PROPOSAL_FREE_TEXT') { $freetext = GETPOST('PROPOSAL_FREE_TEXT', 'none'); // No alpha here, we want exact string @@ -150,7 +170,7 @@ if ($action == 'set_PROPOSAL_FREE_TEXT') } } -if ($action == 'setdefaultduration') +else if ($action == 'setdefaultduration') { $res = dolibarr_set_const($db, "PROPALE_VALIDITY_DURATION", $value, 'chaine', 0, '', $conf->entity); @@ -166,7 +186,7 @@ if ($action == 'setdefaultduration') } } -if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') +else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') { $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL", $value, 'chaine', 0, '', $conf->entity); @@ -183,7 +203,7 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') } // Activate a model -if ($action == 'set') +else if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); } @@ -499,6 +519,106 @@ foreach ($dirmodels as $reldir) } print ''; + +/* + * Payment mode + */ +if (empty($conf->facture->enabled)) +{ + print '
'; + print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInProposal"),'',''); + + print '
'; + print ''; + + print ''; + + print ''; + print ''; + print ''; + print "\n"; + + print ''; + print ""; + print ""; + + print ''; + print ""; + print ""; + print "
'; + print ''; + print $langs->trans("PaymentMode").'
".$langs->trans("SuggestPaymentByRIBOnAccount").""; + 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 '"; + } + else + { + print "".$langs->trans("NoActiveBankAccountDefined").""; + } + } + } + else + { + print $langs->trans("BankModuleNotActive"); + } + print "
".$langs->trans("SuggestPaymentByChequeToAddress").""; + print '"; + print "
"; + print "
"; +} + print '
'; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 62ab3452562..5a063fcbf4a 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2118,7 +2118,7 @@ elseif ($id || $ref) if ($obj) { // $obj->rowid is rowid in $origin."det" table - $alreadysent[$obj->rowid][$obj->shipmentline_id]=array('shipment_ref'=>$obj->shipment_ref, 'shipment_id'=>$obj->shipment_id, 'warehouse'=>$obj->fk_entrepot, 'qty_shipped'=>$obj->qty_shipped, 'date_valid'=>$obj->date_valid, 'date_delivery'=>$obj->date_delivery); + $alreadysent[$obj->rowid][$obj->shipmentline_id]=array('shipment_ref'=>$obj->shipment_ref, 'shipment_id'=>$obj->shipment_id, 'warehouse'=>$obj->fk_entrepot, 'qty_shipped'=>$obj->qty_shipped, 'date_valid'=>$db->jdate($obj->date_valid), 'date_delivery'=>$db->jdate($obj->date_delivery)); } $i++; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6b3568bea31..6fc421e19a4 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1249,6 +1249,7 @@ SupplierPaymentSetup=Vendor payments setup PropalSetup=Commercial proposals module setup ProposalsNumberingModules=Commercial proposal numbering models ProposalsPDFModules=Commercial proposal documents models +SuggestedPaymentModesIfNotDefinedInProposal=Suggested payments mode on proposal by default if not defined for proposal FreeLegalTextOnProposal=Free text on commercial proposals WatermarkOnDraftProposal=Watermark on draft commercial proposals (none if empty) BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL=Ask for bank account destination of proposal