Merge remote-tracking branch 'upstream/develop' into extrafields_object_filter
This commit is contained in:
commit
6f95ffe650
222 changed files with 3366 additions and 1705 deletions
|
|
@ -11,7 +11,7 @@ NEW value for FICHINTER_DISABLE_DETAILS. If FICHINTER_DISABLE_DETAILS is set to
|
|||
|
||||
For developers:
|
||||
---------------
|
||||
|
||||
QUAL line classes for various business object classes have been moved to individual files.
|
||||
|
||||
|
||||
WARNING:
|
||||
|
|
|
|||
|
|
@ -9,25 +9,25 @@
|
|||
*/
|
||||
return [
|
||||
// # Issue statistics:
|
||||
// PhanUndeclaredProperty : 800+ occurrences
|
||||
// PhanPluginUnknownPropertyType : 710+ occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 600+ occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 410+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 380+ occurrences
|
||||
// PhanPluginUnknownArrayMethodReturnType : 310+ occurrences
|
||||
// PhanPluginUnknownArrayMethodParamType : 260+ occurrences
|
||||
// PhanUndeclaredProperty : 680+ occurrences
|
||||
// PhanPluginUnknownPropertyType : 630+ occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 580+ occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 400+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 350+ occurrences
|
||||
// PhanPluginUnknownArrayMethodReturnType : 300+ occurrences
|
||||
// PhanPluginUnknownArrayMethodParamType : 250+ occurrences
|
||||
// PhanPossiblyUndeclaredVariable : 200+ occurrences
|
||||
// PhanTypeMismatchProperty : 170+ occurrences
|
||||
// PhanPluginUnknownArrayFunctionParamType : 95+ occurrences
|
||||
// PhanTypeMismatchArgumentNullableInternal : 70+ occurrences
|
||||
// PhanPluginUndeclaredVariableIsset : 65+ occurrences
|
||||
// PhanPluginUnknownArrayPropertyType : 60+ occurrences
|
||||
// PhanPluginUnknownArrayPropertyType : 55+ occurrences
|
||||
// PhanPluginUnknownArrayFunctionReturnType : 50+ occurrences
|
||||
// PhanRedefineFunction : 50+ occurrences
|
||||
// PhanPluginEmptyStatementIf : 45+ occurrences
|
||||
// PhanTypeMismatchDimFetch : 40+ occurrences
|
||||
// PhanTypeExpectedObjectPropAccess : 25+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 25+ occurrences
|
||||
// PhanTypeExpectedObjectPropAccess : 40+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 35+ occurrences
|
||||
// PhanTypeMismatchDimFetch : 30+ occurrences
|
||||
// PhanPluginUnknownObjectMethodCall : 15+ occurrences
|
||||
// PhanTypeComparisonFromArray : 15+ occurrences
|
||||
// PhanUndeclaredConstant : 15+ occurrences
|
||||
|
|
@ -42,9 +42,9 @@ return [
|
|||
// PhanPluginDuplicateExpressionBinaryOp : 7 occurrences
|
||||
// PhanParamTooMany : 5 occurrences
|
||||
// PhanPluginDuplicateArrayKey : 4 occurrences
|
||||
// PhanTypeExpectedObjectPropAccessButGotNull : 4 occurrences
|
||||
// PhanEmptyFQSENInClasslike : 3 occurrences
|
||||
// PhanInvalidFQSENInClasslike : 3 occurrences
|
||||
// PhanTypeExpectedObjectPropAccessButGotNull : 3 occurrences
|
||||
// PhanAccessMethodProtected : 1 occurrence
|
||||
// PhanTypeConversionFromArray : 1 occurrence
|
||||
|
||||
|
|
@ -52,8 +52,6 @@ return [
|
|||
'file_suppressions' => [
|
||||
'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanPluginUnknownArrayPropertyType'],
|
||||
'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/accountancy/class/accountingjournal.class.php' => ['PhanTypeInvalidDimOffset'],
|
||||
'htdocs/accountancy/journal/purchasesjournal.php' => ['PhanTypeInvalidDimOffset'],
|
||||
'htdocs/adherents/list.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/admin/fckeditor.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/api/class/api_access.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'],
|
||||
|
|
@ -210,7 +208,7 @@ return [
|
|||
'htdocs/compta/tva/index.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/tva/payments.php' => ['PhanTypeMismatchArgumentNullableInternal'],
|
||||
'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/contact/canvas/actions_contactcard_common.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty', 'PhanTypeSuspiciousNonTraversableForeach'],
|
||||
'htdocs/contact/canvas/actions_contactcard_common.class.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/contact/card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/contact/class/contact.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType'],
|
||||
'htdocs/contact/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
|
|
@ -360,19 +358,16 @@ return [
|
|||
'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/commande/modules_commande.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgumentNullableInternal'],
|
||||
'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/core/modules/delivery/mod_delivery_saphir.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/expedition/doc/pdf_espadon.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/facture/doc/pdf_crabe.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/facture/doc/pdf_sponge.modules.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/facture/modules_facture.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/fichinter/mod_pacific.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -395,7 +390,6 @@ return [
|
|||
'htdocs/core/modules/printsheet/modules_labels.php' => ['PhanParamTooMany'],
|
||||
'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/project/doc/pdf_baleine.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
|
|
@ -408,10 +402,10 @@ return [
|
|||
'htdocs/core/modules/societe/mod_codecompta_digitaria.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullableInternal'],
|
||||
'htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
|
|
@ -436,14 +430,12 @@ return [
|
|||
'htdocs/core/tpl/filemanager.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/core/tpl/formlayoutai.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/core/tpl/list_print_total.tpl.php' => ['PhanPluginUndeclaredVariableIsset'],
|
||||
'htdocs/core/tpl/login.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/core/tpl/massactions_pre.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/tpl/notes.tpl.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/tpl/object_discounts.tpl.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/tpl/objectline_create.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/tpl/objectline_edit.tpl.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/tpl/objectline_title.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanTypeExpectedObjectPropAccessButGotNull', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/tpl/objectline_view.tpl.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/tpl/onlinepaymentlinks.tpl.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/core/tpl/passwordforgotten.tpl.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/core/tpl/passwordreset.tpl.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
|
|
@ -743,7 +735,6 @@ return [
|
|||
'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'],
|
||||
'htdocs/public/test/test_forms.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/public/ticket/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/public/webportal/webportal.main.inc.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanRedefineFunction'],
|
||||
|
|
@ -790,23 +781,19 @@ return [
|
|||
'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'],
|
||||
'htdocs/societe/ajax/ajaxcompanies.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/societe/ajax/company.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/societe/card.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/societe/checkvat/checkVatPopup.php' => ['PhanPossiblyUndeclaredGlobalVariable'],
|
||||
'htdocs/societe/class/api_contacts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/societe/class/api_thirdparties.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/societe/class/client.class.php' => ['PhanPluginUnknownArrayPropertyType'],
|
||||
'htdocs/societe/class/companybankaccount.class.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/societe/class/companypaymentmode.class.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/societe/class/societeaccount.class.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/societe/paymentmodes.php' => ['PhanPossiblyNullTypeMismatchProperty', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/societe/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/stripe/ajax/ajax.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition', 'PhanPluginUnknownArrayMethodParamType', 'PhanUndeclaredProperty'],
|
||||
'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/stripe/class/stripe.class.php' => ['PhanPluginConstantVariableNull', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanUndeclaredProperty'],
|
||||
'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
@ -835,13 +822,12 @@ return [
|
|||
'htdocs/theme/md/flags-sprite.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/theme/md/info-box.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/theme/md/progress.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/ticket/card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/class/actions_ticket.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownPropertyType', 'PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/class/api_tickets.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/ticket/class/api_tickets.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/ticket/class/cticketcategory.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/class/ticket.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownArrayPropertyType', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/class/ticket.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/class/ticketstats.class.php' => ['PhanPluginUnknownPropertyType'],
|
||||
'htdocs/ticket/contact.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/ticket/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'],
|
||||
'htdocs/ticket/list.php' => ['PhanTypeComparisonFromArray'],
|
||||
'htdocs/ticket/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ return [
|
|||
'exclude_file_regex' => '@^(' // @phpstan-ignore-line
|
||||
.'dummy' // @phpstan-ignore-line
|
||||
// mymodule seen in cti, but not in git.
|
||||
.'|htdocs/custom/mymodule/.*' // @phpstan-ignore-line
|
||||
.'|htdocs/custom/.*' // Ignore all custom modules @phpstan-ignore-line
|
||||
.'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line
|
||||
//.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line
|
||||
// Included as stub (better analysis)
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ $config['suppress_issue_types'] = [
|
|||
|
||||
'PhanPluginUnknownArrayMethodParamType', // this option costs more time to be supported than it solves time
|
||||
'PhanPluginUnknownArrayMethodReturnType', // this option costs more time to be supported than it solves time
|
||||
'PhanTypeSuspiciousNonTraversableForeach', // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code.
|
||||
];
|
||||
|
||||
return $config;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
/**
|
||||
* Class to manage accountancy systems
|
||||
*/
|
||||
class AccountancySystem
|
||||
class AccountancySystem extends CommonObject
|
||||
{
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
|
|
@ -58,17 +58,13 @@ class AccountancySystem
|
|||
public $rowid;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_pcg_version;
|
||||
|
||||
/**
|
||||
* @var int pcg version
|
||||
* @var string Accountancy system code
|
||||
*/
|
||||
public $pcg_version;
|
||||
|
||||
/**
|
||||
* @var string ref
|
||||
* @var string Ref of accountancy system. Duplicate property with ->pcg_version.
|
||||
* @see $pcg_version
|
||||
*/
|
||||
public $ref;
|
||||
|
||||
|
|
@ -77,31 +73,11 @@ class AccountancySystem
|
|||
*/
|
||||
public $active;
|
||||
|
||||
/**
|
||||
* @var string pcg type
|
||||
*/
|
||||
public $pcg_type;
|
||||
|
||||
/**
|
||||
* @var string Accountancy System numero
|
||||
*/
|
||||
public $numero;
|
||||
|
||||
/**
|
||||
* @var string Accountancy System label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var string account number
|
||||
*/
|
||||
public $account_number;
|
||||
|
||||
/**
|
||||
* @var string account parent
|
||||
*/
|
||||
public $account_parent;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
|
@ -190,12 +166,12 @@ class AccountancySystem
|
|||
$result = $this->rowid;
|
||||
} else {
|
||||
$result = - 2;
|
||||
$this->error = "AccountancySystem::Create Error $result";
|
||||
$this->error = "AccountancySystem::Create Error $result: " . $this->db->lasterror();
|
||||
dol_syslog($this->error, LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
$result = - 1;
|
||||
$this->error = "AccountancySystem::Create Error $result";
|
||||
$this->error = "AccountancySystem::Create Error $result: " . $this->db->lasterror();
|
||||
dol_syslog($this->error, LOG_ERR);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -377,6 +377,23 @@ if ($result) {
|
|||
'code_compta' => $compta_soc
|
||||
);
|
||||
|
||||
// After the line is processed
|
||||
$parameters = array(
|
||||
'obj' => $obj,
|
||||
'tabfac' => &$tabfac,
|
||||
'tabht' => &$tabht,
|
||||
'tabtva' => &$tabtva,
|
||||
'def_tva' => &$def_tva,
|
||||
'tabwarranty' => &$tabwarranty,
|
||||
'tabrevenuestamp' => &$tabrevenuestamp,
|
||||
'tabttc' => &$tabttc,
|
||||
'tablocaltax1' => &$tablocaltax1,
|
||||
'tablocaltax2' => &$tablocaltax2,
|
||||
'tabcompany' => &$tabcompany,
|
||||
'vatdata_cache' => &$vatdata_cache,
|
||||
);
|
||||
$reshook = $hookmanager->executeHooks('processingJournalData', $parameters); // Note that $action and $object may have been modified by hook
|
||||
|
||||
$i++;
|
||||
|
||||
// Check for too many lines.
|
||||
|
|
|
|||
|
|
@ -130,6 +130,11 @@ if ($action == 'update') {
|
|||
}
|
||||
}
|
||||
|
||||
if (GETPOSTISSET('THEME_ELDY_BORDER_RADIUS')) {
|
||||
$val = GETPOST('THEME_ELDY_BORDER_RADIUS');
|
||||
dolibarr_set_const($db, 'THEME_ELDY_BORDER_RADIUS', GETPOSTINT('THEME_ELDY_BORDER_RADIUS'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'), array()))));
|
||||
if ($val == '') {
|
||||
dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2023 Juanjo Menent <jmenent@2byte.es>
|
||||
|
|
@ -56,7 +56,7 @@ if (GETPOSTISSET('mode')) {
|
|||
dolibarr_set_const($db, "MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT", $mode, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
} else {
|
||||
$mode = (!getDolGlobalString('MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT') ? 'commonkanban' : $conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT);
|
||||
$mode = getDolGlobalString('MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT', 'commonkanban');
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
|
@ -229,13 +229,68 @@ if ($action == 'install' && $allowonlineinstall) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// TODO Make more test
|
||||
}
|
||||
|
||||
dol_syslog("Uncompress of module file is a success.");
|
||||
|
||||
// We check if this is a metapackage
|
||||
// Load module into $objMod
|
||||
/*
|
||||
$modulesdir = array($modulenamedir.'/core/modules/');
|
||||
foreach ($modulesdir as $dir) {
|
||||
// Load modules attributes in arrays (name, numero, orders) from dir directory
|
||||
//print $dir."\n<br>";
|
||||
dol_syslog("Scan directory ".$dir." for module descriptor files (modXXX.class.php)");
|
||||
$handle = @opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
print $dir." ".$file."\n<br>";
|
||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') {
|
||||
$modName = substr($file, 0, dol_strlen($file) - 10);
|
||||
if ($modName) {
|
||||
try {
|
||||
$res = include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error.
|
||||
$modName = substr($file, 0, dol_strlen($file) - 10);
|
||||
if ($modName) {
|
||||
if (class_exists($modName)) {
|
||||
$objMod = new $modName($db);
|
||||
'@phan-var-force DolibarrModules $objMod';
|
||||
|
||||
//var_dump($objMod);
|
||||
}
|
||||
}
|
||||
} catch(Exception $e) {
|
||||
// Nothing done
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Check if module is in the remote malware list
|
||||
if (!$error) {
|
||||
if (GETPOST('checkforcompliance') == 'on') {
|
||||
try {
|
||||
$res = include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
|
||||
$dolibarrmodule = new DolibarrModules($db);
|
||||
$checkRes = $dolibarrmodule->checkForcompliance($modulename);
|
||||
|
||||
if (!is_numeric($checkRes) && $checkRes != '') {
|
||||
$langs->load("errors");
|
||||
setEventMessages($modulename.' : '.$langs->trans($checkRes), null, 'errors');
|
||||
}
|
||||
|
||||
$error++;
|
||||
} catch (Exception $e) {
|
||||
// Nothing done
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// TODO Make more test ???
|
||||
}
|
||||
|
||||
// We check if this is a metapackage (and wecomplete with child packages)
|
||||
$modulenamearrays = array();
|
||||
if (dol_is_file($modulenamedir.'/metapackage.conf')) {
|
||||
// This is a meta package
|
||||
|
|
@ -245,32 +300,34 @@ if ($action == 'install' && $allowonlineinstall) {
|
|||
$modulenamearrays[$modulename] = $modulename;
|
||||
//var_dump($modulenamearrays);exit;
|
||||
|
||||
// Lop on each package of the metapackage
|
||||
foreach ($modulenamearrays as $modulenameval) {
|
||||
if (strpos($modulenameval, '#') === 0) {
|
||||
continue; // Discard comments
|
||||
}
|
||||
if (strpos($modulenameval, '//') === 0) {
|
||||
continue; // Discard comments
|
||||
}
|
||||
if (!trim($modulenameval)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Now we install the module
|
||||
if (!$error) {
|
||||
@dol_delete_dir_recursive($dirins.'/'.$modulenameval); // delete the target directory
|
||||
$submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulenameval;
|
||||
if (!dol_is_dir($submodulenamedir)) {
|
||||
$submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval;
|
||||
// Lop on each packages (can have several if package is a metapackage)
|
||||
if (! $error) {
|
||||
foreach ($modulenamearrays as $modulenameval) {
|
||||
if (strpos($modulenameval, '#') === 0) {
|
||||
continue; // Discard comments
|
||||
}
|
||||
dol_syslog("We copy now directory ".$submodulenamedir." into target dir ".$dirins.'/'.$modulenameval);
|
||||
$result = dolCopyDir($submodulenamedir, $dirins.'/'.$modulenameval, '0444', 1);
|
||||
if ($result <= 0) {
|
||||
dol_syslog('Failed to call dolCopyDir result='.$result." with param ".$submodulenamedir." and ".$dirins.'/'.$modulenameval, LOG_WARNING);
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFailToCopyDir", $submodulenamedir, $dirins.'/'.$modulenameval), null, 'errors');
|
||||
$error++;
|
||||
if (strpos($modulenameval, '//') === 0) {
|
||||
continue; // Discard comments
|
||||
}
|
||||
if (!trim($modulenameval)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Now we install the module
|
||||
if (!$error) {
|
||||
@dol_delete_dir_recursive($dirins.'/'.$modulenameval); // delete the target directory
|
||||
$submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulenameval;
|
||||
if (!dol_is_dir($submodulenamedir)) {
|
||||
$submodulenamedir = $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval;
|
||||
}
|
||||
dol_syslog("We copy now directory ".$submodulenamedir." into target dir ".$dirins.'/'.$modulenameval);
|
||||
$result = dolCopyDir($submodulenamedir, $dirins.'/'.$modulenameval, '0444', 1);
|
||||
if ($result <= 0) {
|
||||
dol_syslog('Failed to call dolCopyDir result='.$result." with param ".$submodulenamedir." and ".$dirins.'/'.$modulenameval, LOG_WARNING);
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFailToCopyDir", $submodulenamedir, $dirins.'/'.$modulenameval), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -294,8 +351,6 @@ if ($action == 'install' && $allowonlineinstall) {
|
|||
$message = $langs->trans("SetupIsReadyForUse", $redirectUrl, $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules"));
|
||||
|
||||
setEventMessages($message, null, 'warnings');
|
||||
header('Location: ' . $redirectUrl);
|
||||
exit;
|
||||
}
|
||||
} elseif ($action == 'install' && !$allowonlineinstall) {
|
||||
httponly_accessforbidden("You try to bypass the protection to disallow deployment of an external module. Hack attempt ?");
|
||||
|
|
@ -654,7 +709,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||
$moreforfilter = '<div class="valignmiddle">';
|
||||
|
||||
$moreforfilter .= '<div class="floatright right pagination paddingtop --module-list"><ul><li>';
|
||||
$moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdate').'<br>'.$langs->trans('CheckForModuleUpdateHelp'), 'fa fa-sync', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss' => 'reposition'));
|
||||
$moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdate').'<br><br>'.img_warning('', '', 'paddingright').$langs->trans('CheckForModuleUpdateHelp').$langs->trans('CheckForModuleUpdateHelp'), 'fa fa-sync', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss' => 'reposition'));
|
||||
$moreforfilter .= dolGetButtonTitleSeparator();
|
||||
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', ($mode == 'common' ? 2 : 1), array('morecss' => 'reposition'));
|
||||
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', ($mode == 'commonkanban' ? 2 : 1), array('morecss' => 'reposition'));
|
||||
|
|
@ -887,6 +942,14 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||
}
|
||||
}
|
||||
|
||||
if ($objMod->isCoreOrExternalModule() == 'external' && $action == 'checklastversion' && !getDolGlobalString('DISABLE_CHECK_ON_MALWARE_MODULES')) {
|
||||
$checkRes = $objMod->checkForCompliance(); // Check if module is reported as non compliant with Dolibarr rules and law
|
||||
if (!is_numeric($checkRes) && $checkRes != '') {
|
||||
$langs->load("errors");
|
||||
setEventMessages($objMod->getName().' : '.$langs->trans($checkRes), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Define imginfo
|
||||
$imginfo = "info";
|
||||
if ($objMod->isCoreOrExternalModule() == 'external') {
|
||||
|
|
@ -1224,7 +1287,7 @@ if ($mode == 'marketplace') {
|
|||
}
|
||||
|
||||
|
||||
// Install external module
|
||||
// Form to install an external module
|
||||
|
||||
if ($mode == 'deploy') {
|
||||
print dol_get_fiche_head($head, $mode, '', -1);
|
||||
|
|
@ -1271,13 +1334,13 @@ if ($mode == 'deploy') {
|
|||
print '<br>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
// $allowfromweb = -1 if installation or setup not correct, 0 if not allowed, 1 if allowed
|
||||
if ($allowfromweb >= 0) {
|
||||
if ($allowfromweb == 1) {
|
||||
//print $langs->trans("ThisIsProcessToFollow").'<br>';
|
||||
} else {
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
|
||||
print '<b>'.$langs->trans("StepNb", 1).'</b>: ';
|
||||
print str_replace('{s1}', $fullurl, $langs->trans("FindPackageFromWebSite", '{s1}')).'<br>';
|
||||
|
|
@ -1292,7 +1355,11 @@ if ($mode == 'deploy') {
|
|||
print '<input type="hidden" name="action" value="install">';
|
||||
print '<input type="hidden" name="mode" value="deploy">';
|
||||
|
||||
print $langs->trans("YouCanSubmitFile").'<br><br>';
|
||||
print $langs->trans("YouCanSubmitFile").'<br><br><br>';
|
||||
|
||||
print '<span class="opacitymedium"><input class="paddingright" type="checkbox" name="checkforcompliance" id="checkforcompliance"'.(getDolGlobalString('DISABLE_CHECK_ON_MALWARE_MODULES') ? ' disabled="disabled"' : 'checked="checked"').'>';
|
||||
print '<label for="checkforcompliance">'.$form->textwithpicto($langs->trans("CheckIfModuleIsNotBlackListed"), $langs->trans("CheckIfModuleIsNotBlackListedHelp")).'</label>';
|
||||
print '</span><br><br>';
|
||||
|
||||
$max = getDolGlobalString('MAIN_UPLOAD_DOC'); // In Kb
|
||||
$maxphp = @ini_get('upload_max_filesize'); // In unknown
|
||||
|
|
@ -1360,7 +1427,7 @@ if ($mode == 'deploy') {
|
|||
print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';
|
||||
}
|
||||
|
||||
print '<input class="flat minwidth400" type="file" name="fileinstall" id="fileinstall"> ';
|
||||
print '<input class="flat minwidth400" type="file" name="fileinstall" id="fileinstall">';
|
||||
|
||||
print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Upload")).'" class="button small">';
|
||||
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ if (GETPOST('withtab', 'alpha')) {
|
|||
print dol_get_fiche_head($head, 'fingerprints', '', -1);
|
||||
}
|
||||
|
||||
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("FingerprintsDesc")."<br></span>\n";
|
||||
print '<div class="opacitymedium hideonsmartphone justify">'.$langs->trans("FingerprintsDesc")."<br></div>\n";
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
|
|
|||
|
|
@ -162,6 +162,8 @@ class CActionComm
|
|||
global $langs, $conf, $user;
|
||||
$langs->load("commercial");
|
||||
|
||||
$actionstatic = new ActionComm($this->db);
|
||||
|
||||
$rep_id = array();
|
||||
$rep_code = array();
|
||||
$rep_all = array();
|
||||
|
|
@ -294,17 +296,25 @@ class CActionComm
|
|||
}
|
||||
|
||||
$label = (($transcode != $keyfortrans) ? $transcode : $langs->trans($obj->label));
|
||||
/*
|
||||
$actionstatic->type_color = $obj->type_color;
|
||||
$actionstatic->type_picto = $obj->type_picto;
|
||||
$actionstatic->type = $obj->type;
|
||||
$picto = $actionstatic->getTypePicto();
|
||||
$label = $picto.$label;
|
||||
*/
|
||||
|
||||
if (($onlyautoornot == -1 || $onlyautoornot == -2) && getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
|
||||
// Add a group of elements
|
||||
if ($typecalendar == 'system' || $typecalendar == 'user') {
|
||||
$label = ' '.$label;
|
||||
$TSystem['id'][-99] = $langs->trans("ActionAC_MANUAL");
|
||||
$TSystem['code']['AC_NON_AUTO'] = '-- '.$langs->trans("ActionAC_MANUAL");
|
||||
$TSystem['code']['AC_NON_AUTO'] = '<small>-- '.$langs->trans("ActionAC_MANUAL").'</small>';
|
||||
}
|
||||
if ($typecalendar == 'systemauto') {
|
||||
$label = ' '.$label;
|
||||
$TSystemAuto['id'][-98] = $langs->trans("ActionAC_AUTO");
|
||||
$TSystemAuto['code']['AC_ALL_AUTO'] = '-- '.$langs->trans("ActionAC_AUTO");
|
||||
$TSystemAuto['code']['AC_ALL_AUTO'] = '<small>-- '.$langs->trans("ActionAC_AUTO").'</small>';
|
||||
}
|
||||
|
||||
if ($typecalendar == 'module') {
|
||||
|
|
@ -314,7 +324,7 @@ class CActionComm
|
|||
$idforallfornewmodule--;
|
||||
}
|
||||
$TModule['id'][-1 * $idforallfornewmodule] = $langs->trans("ActionAC_ALL_".strtoupper($module));
|
||||
$TModule['code']['AC_ALL_'.strtoupper($module)] = '-- '.$langs->trans("Module").' '.ucfirst($module);
|
||||
$TModule['code']['AC_ALL_'.strtoupper($module)] = '<small>-- '.$langs->trans("Module").' '.ucfirst($module).'</small>';
|
||||
}
|
||||
}
|
||||
// Add element
|
||||
|
|
|
|||
|
|
@ -1726,11 +1726,11 @@ if (empty($mode) || $mode == 'show_month') { // View by month
|
|||
print '</div>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min sectioncalendarbyday maxscreenheightless300">';
|
||||
echo '<table class="tagtable centpercent noborder nocellnopadd cal_pannel cal_month noborderbottom" style="margin-bottom: 5px !important;">';
|
||||
echo '<table class="tagtable centpercent noborder nocellnopadd cal_pannel cal_month" style="margin-bottom: 10px !important;">';
|
||||
|
||||
echo ' <tr class="tagtr liste_titre">';
|
||||
echo ' <td class="tagtd center bold uppercase">'.$langs->trans("Day".$arraytimestamp['wday'])."</td>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
|
||||
/*
|
||||
echo ' <div class="tagtr">';
|
||||
|
|
@ -1741,13 +1741,12 @@ if (empty($mode) || $mode == 'show_month') { // View by month
|
|||
echo " </div>\n";
|
||||
*/
|
||||
|
||||
echo '</table>';
|
||||
print '</div>';
|
||||
print '<tr><td>';
|
||||
|
||||
/* WIP View per hour */
|
||||
$useviewhour = 0;
|
||||
if ($useviewhour) {
|
||||
print '<div class="div-table-responsive-no-min borderbottom">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
|
||||
$maxheightwin = (isset($_SESSION["dol_screenheight"]) && $_SESSION["dol_screenheight"] > 500) ? ($_SESSION["dol_screenheight"] - 200) : 660; // Also into index.php file
|
||||
|
||||
|
|
@ -1787,13 +1786,19 @@ if (empty($mode) || $mode == 'show_month') { // View by month
|
|||
|
||||
print '</div>';
|
||||
} else {
|
||||
print '<div class="div-table-responsive-no-min borderbottom">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0, $bookcalcalendars);
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
echo '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print "\n".'</form>';
|
||||
|
|
|
|||
|
|
@ -761,6 +761,8 @@ print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
|||
print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, '', $filtert, '', $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid, $search_categ_cus);
|
||||
print '</div>';
|
||||
|
||||
$moreforfilter = 1;
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -1106,7 +1106,7 @@ if ($object->id > 0) {
|
|||
print '<table class="noborder centpercent lastrecordtable">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="5"><table class="centpercent nobordernopadding"><tr><td>'.$langs->trans("LastSendings", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/expedition/list.php?socid='.$object->id.'"><span class="hideonsmartphone">'.$langs->trans("AllSendings").'</span><span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
print '<td colspan="5"><table class="centpercent nobordernopadding"><tr><td>'.$langs->trans("LastSendings", ($num < $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/expedition/list.php?socid='.$object->id.'"><span class="hideonsmartphone">'.$langs->trans("AllSendings").'</span><span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/expedition/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@ if (empty($reshook)) {
|
|||
|
||||
$trackid = 'emailing-test';
|
||||
$upload_dir_tmp = $upload_dir;
|
||||
$mailfile = new CMailFile($tmpsujet, $object->sendto, $object->email_from, $tmpbody, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $object->email_errorsto, $arr_css, $trackid, '', 'emailing', '', $upload_dir_tmp);
|
||||
$mailfile = new CMailFile($tmpsujet, $object->sendto, $object->email_from, $tmpbody, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $object->email_errorsto, $arr_css, $trackid, '', 'emailing', $object->email_replyto, $upload_dir_tmp);
|
||||
|
||||
$result = $mailfile->sendfile();
|
||||
if ($result) {
|
||||
|
|
@ -833,6 +833,8 @@ if ($action == 'create') { // aaa
|
|||
|
||||
print '<tr class="fieldsforemail"><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.getDolGlobalString('MAILING_EMAIL_ERRORSTO', getDolGlobalString('MAIN_MAIL_ERRORS_TO')).'"></td></tr>';
|
||||
|
||||
print '<tr class="fieldsforemail"><td>'.$langs->trans("MailReply").'</td><td><input class="flat minwidth200" name="replyto" value="'.getDolGlobalString('MAILING_EMAIL_REPLYTO', getDolGlobalString('MAIN_MAIL_REPLY_TO')).'"></td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
|
@ -1377,6 +1379,7 @@ if ($action == 'create') { // aaa
|
|||
// To
|
||||
if ($object->messtype != 'sms') {
|
||||
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td>'.dol_print_email($object->email_errorsto, 0, 0, 0, 0, 1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("MailReply").'</td><td>'.dol_print_email($object->email_replyto, 0, 0, 0, 0, 1).'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
|
|
|||
|
|
@ -564,7 +564,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
|||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($search_all > 0) {
|
||||
if ($search_all !== '') {
|
||||
$sql = 'SELECT DISTINCT';
|
||||
}
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax , s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client,';
|
||||
|
|
|
|||
|
|
@ -2732,33 +2732,36 @@ while ($i < $imaxinloop) {
|
|||
|
||||
$numlines = count($generic_commande->lines); // Loop on each line of order
|
||||
for ($lig = 0; $lig < $numlines; $lig++) {
|
||||
if (isset($generic_commande->expeditions[$generic_commande->lines[$lig]->id])) {
|
||||
$reliquat = $generic_commande->lines[$lig]->qty - $generic_commande->expeditions[$generic_commande->lines[$lig]->id];
|
||||
$orderLine = $generic_commande->lines[$lig];
|
||||
'@phan-var-force OrderLine $orderLine';
|
||||
if (isset($generic_commande->expeditions[$orderLine->id])) {
|
||||
$reliquat = $orderLine->qty - $generic_commande->expeditions[$orderLine->id];
|
||||
} else {
|
||||
$reliquat = $generic_commande->lines[$lig]->qty;
|
||||
$reliquat = $orderLine->qty;
|
||||
}
|
||||
if ($generic_commande->lines[$lig]->product_type == 0 && $generic_commande->lines[$lig]->fk_product > 0) { // If line is a product and not a service
|
||||
if ($orderLine->product_type == 0 && $orderLine->fk_product > 0) { // If line is a product and not a service
|
||||
$nbprod++; // order contains real products
|
||||
$generic_product->id = $generic_commande->lines[$lig]->fk_product;
|
||||
$generic_product->id = $orderLine->fk_product;
|
||||
|
||||
// Get local and virtual stock and store it into cache
|
||||
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) {
|
||||
if (empty($productstat_cache[$orderLine->fk_product])) {
|
||||
$generic_product->load_stock('nobatch,warehouseopen'); // ->load_virtual_stock() is already included into load_stock()
|
||||
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel;
|
||||
$productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
|
||||
$productstat_cache[$orderLine->fk_product]['stock_reel'] = $generic_product->stock_reel;
|
||||
$productstat_cachevirtual[$orderLine->fk_product]['stock_reel'] = $generic_product->stock_theorique;
|
||||
} else {
|
||||
$generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
|
||||
$generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
|
||||
$generic_product->stock_reel = $productstat_cache[$orderLine->fk_product]['stock_reel'];
|
||||
// @phan-suppress-next-line PhanTypeInvalidDimOffset
|
||||
$generic_product->stock_theorique = $productstat_cachevirtual[$orderLine->fk_product]['stock_reel'];
|
||||
}
|
||||
|
||||
if ($reliquat > $generic_product->stock_reel) {
|
||||
$notshippable++;
|
||||
}
|
||||
if (!getDolGlobalString('SHIPPABLE_ORDER_ICON_IN_LIST')) { // Default code. Default should be this case.
|
||||
$text_info .= $reliquat.' x '.$generic_commande->lines[$lig]->product_ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 20);
|
||||
$text_info .= $reliquat.' x '.$orderLine->product_ref.' '.dol_trunc($orderLine->product_label, 20);
|
||||
$text_info .= ' - '.$langs->trans("Stock").': <span class="'.($generic_product->stock_reel > 0 ? 'ok' : 'error').'">'.$generic_product->stock_reel.'</span>';
|
||||
$text_info .= ' - '.$langs->trans("VirtualStock").': <span class="'.($generic_product->stock_theorique > 0 ? 'ok' : 'error').'">'.$generic_product->stock_theorique.'</span>';
|
||||
$text_info .= ($reliquat != $generic_commande->lines[$lig]->qty ? ' <span class="opacitymedium">('.$langs->trans("QtyInOtherShipments").' '.($generic_commande->lines[$lig]->qty - $reliquat).')</span>' : '');
|
||||
$text_info .= ($reliquat != $orderLine->qty ? ' <span class="opacitymedium">('.$langs->trans("QtyInOtherShipments").' '.($orderLine->qty - $reliquat).')</span>' : '');
|
||||
$text_info .= '<br>';
|
||||
} else { // BUGGED CODE.
|
||||
// DOES NOT TAKE INTO ACCOUNT MANUFACTURING. THIS CODE SHOULD BE USELESS. PREVIOUS CODE SEEMS COMPLETE.
|
||||
|
|
@ -2769,29 +2772,29 @@ while ($i < $imaxinloop) {
|
|||
$stock_order_supplier = 0;
|
||||
if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT') || getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) { // What about other options ?
|
||||
if (isModEnabled('order')) {
|
||||
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) {
|
||||
if (empty($productstat_cache[$orderLine->fk_product]['stats_order_customer'])) {
|
||||
$generic_product->load_stats_commande(0, '1,2');
|
||||
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];
|
||||
$productstat_cache[$orderLine->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];
|
||||
} else {
|
||||
// @phan-suppress-next-line PhanTypeInvalidDimOffset
|
||||
$generic_product->stats_commande['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'];
|
||||
$generic_product->stats_commande['qty'] = $productstat_cache[$orderLine->fk_product]['stats_order_customer'];
|
||||
}
|
||||
$stock_order = $generic_product->stats_commande['qty'];
|
||||
}
|
||||
if (isModEnabled("supplier_order")) {
|
||||
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'])) {
|
||||
if (empty($productstat_cache[$orderLine->fk_product]['stats_order_supplier'])) {
|
||||
$generic_product->load_stats_commande_fournisseur(0, '3');
|
||||
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
|
||||
$productstat_cache[$orderLine->fk_product]['stats_order_supplier'] = $generic_product->stats_commande_fournisseur['qty'];
|
||||
} else {
|
||||
// @phan-suppress-next-line PhanTypeInvalidDimOffset
|
||||
$generic_product->stats_commande_fournisseur['qty'] = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_supplier'];
|
||||
$generic_product->stats_commande_fournisseur['qty'] = $productstat_cache[$orderLine->fk_product]['stats_order_supplier'];
|
||||
}
|
||||
$stock_order_supplier = $generic_product->stats_commande_fournisseur['qty'];
|
||||
}
|
||||
}
|
||||
$text_info .= $reliquat.' x '.$generic_commande->lines[$lig]->ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 20);
|
||||
$text_info .= $reliquat.' x '.$orderLine->ref.' '.dol_trunc($orderLine->product_label, 20);
|
||||
$text_stock_reel = $generic_product->stock_reel.'/'.$stock_order;
|
||||
if ($stock_order > $generic_product->stock_reel && !($generic_product->stock_reel < $generic_commande->lines[$lig]->qty)) {
|
||||
if ($stock_order > $generic_product->stock_reel && !($generic_product->stock_reel < $orderLine->qty)) {
|
||||
$warning++;
|
||||
$text_warning .= '<span class="warning">'.$langs->trans('Available').' : '.$text_stock_reel.'</span>';
|
||||
}
|
||||
|
|
@ -2803,7 +2806,7 @@ while ($i < $imaxinloop) {
|
|||
if (isModEnabled("supplier_order")) {
|
||||
$text_info .= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier;
|
||||
}
|
||||
$text_info .= ($reliquat != $generic_commande->lines[$lig]->qty ? ' <span class="opacitymedium">('.$langs->trans("QtyInOtherShipments").' '.($generic_commande->lines[$lig]->qty - $reliquat).')</span>' : '');
|
||||
$text_info .= ($reliquat != $orderLine->qty ? ' <span class="opacitymedium">('.$langs->trans("QtyInOtherShipments").' '.($orderLine->qty - $reliquat).')</span>' : '');
|
||||
$text_info .= '<br>';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2112,7 +2112,7 @@ if ($resql) {
|
|||
$productstat_cachevirtual[$obj->fk_product]['stock_reel'] = $generic_product->stock_theorique;
|
||||
} else {
|
||||
$generic_product->stock_reel = $productstat_cache[$obj->fk_product]['stock_reel'];
|
||||
$generic_product->stock_theorique = $productstat_cachevirtual[$obj->fk_product]['stock_reel'] = $generic_product->stock_theorique;
|
||||
$generic_product->stock_theorique = $productstat_cachevirtual[$obj->fk_product]['stock_reel'];
|
||||
}
|
||||
|
||||
if ($reliquat > $generic_product->stock_reel) {
|
||||
|
|
|
|||
|
|
@ -1417,6 +1417,14 @@ class FactureRec extends CommonInvoice
|
|||
$facture->multicurrency_tx = $facturerec->multicurrency_tx;
|
||||
}
|
||||
|
||||
if (isset($facture->array_options) && isset($facturerec->array_options)) {
|
||||
foreach ($facturerec->array_options as $key => $value) {
|
||||
if (isset($facture->array_options[$key])) {
|
||||
$facture->array_options[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$invoiceidgenerated = $facture->create($user);
|
||||
if ($invoiceidgenerated <= 0) {
|
||||
$this->errors = $facture->errors;
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@ $search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $sear
|
|||
$search_categ_cus = GETPOST("search_categ_cus", 'intcomma');
|
||||
$search_product_category = GETPOST('search_product_category', 'intcomma');
|
||||
$search_fac_rec_source_title = GETPOST("search_fac_rec_source_title", 'alpha');
|
||||
$search_fk_fac_rec_source = GETPOST('search_fk_fac_rec_source', 'int');
|
||||
|
||||
$search_option = GETPOST('search_option');
|
||||
if ($search_option == 'late') {
|
||||
|
|
@ -871,6 +872,9 @@ if ($search_option == 'late') {
|
|||
if (!empty($search_fac_rec_source_title)) {
|
||||
$sql .= natural_search('facrec.titre', $search_fac_rec_source_title);
|
||||
}
|
||||
if ($search_fk_fac_rec_source) {
|
||||
$sql .= ' AND f.fk_fac_rec_source = ' . (int) $search_fk_fac_rec_source;
|
||||
}
|
||||
// Search on user
|
||||
if ($search_user > 0) {
|
||||
$sql .= " AND EXISTS (";
|
||||
|
|
@ -1015,6 +1019,14 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s
|
|||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist');
|
||||
|
||||
if ($search_fk_fac_rec_source) {
|
||||
$object = new FactureRec($db);
|
||||
$object->id = (int) $search_fk_fac_rec_source;
|
||||
$head = invoice_rec_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'generated', $langs->trans('InvoicesGeneratedFromRec'), -1, 'bill'); // Add a div
|
||||
}
|
||||
|
||||
|
||||
$param = '&socid='.urlencode((string) ($socid));
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
|
|
@ -1196,6 +1208,9 @@ if ($search_categ_cus > 0) {
|
|||
if (!empty($search_fac_rec_source_title)) {
|
||||
$param .= '&search_fac_rec_source_title='.urlencode($search_fac_rec_source_title);
|
||||
}
|
||||
if ($search_fk_fac_rec_source) {
|
||||
$param .= '&search_fk_fac_rec_source=' . (int) $search_fk_fac_rec_source;
|
||||
}
|
||||
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ if ($action == 'setref' && $user->hasRight('banque', 'cheque')) {
|
|||
if ($action == 'create' && GETPOSTINT("accountid") > 0 && $user->hasRight('banque', 'cheque')) {
|
||||
if (GETPOSTISARRAY('toRemise')) {
|
||||
$object->type = $type;
|
||||
$object->date_bordereau = dol_now();
|
||||
$arrayofid = GETPOST('toRemise', 'array:int');
|
||||
|
||||
$result = $object->create($user, GETPOSTINT("accountid"), 0, $arrayofid);
|
||||
|
|
@ -168,6 +169,7 @@ if ($action == 'create' && GETPOSTINT("accountid") > 0 && $user->hasRight('banqu
|
|||
exit;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'new';
|
||||
}
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorSelectAtLeastOne"), null, 'mesgs');
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ class RemiseCheque extends CommonObject
|
|||
*/
|
||||
public function validate($user)
|
||||
{
|
||||
global $langs, $conf;
|
||||
global $conf;
|
||||
|
||||
$this->errno = 0;
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ class RemiseCheque extends CommonObject
|
|||
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
|
||||
$sql .= " SET statut = 1, ref = '".$this->db->escape($numref)."'";
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
$sql .= " AND entity = ".((int) $conf->entity);
|
||||
$sql .= " AND statut = 0";
|
||||
|
||||
dol_syslog("RemiseCheque::Validate", LOG_DEBUG);
|
||||
|
|
@ -368,13 +368,15 @@ class RemiseCheque extends CommonObject
|
|||
if ($num == 1) {
|
||||
$this->ref = $numref;
|
||||
$this->statut = 1;
|
||||
$this->status = 1;
|
||||
} else {
|
||||
$this->errno = -1029;
|
||||
dol_syslog("Remisecheque::Validate Error ".$this->errno, LOG_ERR);
|
||||
dol_syslog("Remisecheque::validate Error ".$this->errno, LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
$this->errno = -1033;
|
||||
dol_syslog("Remisecheque::Validate Error ".$this->errno, LOG_ERR);
|
||||
$this->error = $this->db->lasterror();
|
||||
dol_syslog("Remisecheque::validate Error ".$this->errno, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -597,6 +597,9 @@ class CMailFile
|
|||
$msg = $this->checkIfHTML($msg); // This add a header and a body including custom CSS to the HTML content
|
||||
}
|
||||
|
||||
if ($msg === '.') {
|
||||
$msg = "\n.\n";
|
||||
}
|
||||
// Replace . alone on a new line with .. to avoid to have SMTP interpret this as end of message
|
||||
$msg = preg_replace('/(\r|\n)\.(\r|\n)/ims', '\1..\2', $msg);
|
||||
|
||||
|
|
|
|||
|
|
@ -5250,7 +5250,7 @@ abstract class CommonObject
|
|||
|
||||
$i = 0;
|
||||
|
||||
print "<!-- begin printObjectLines() --><tbody>\n";
|
||||
print "<!-- begin printObjectLines() -->\n";
|
||||
foreach ($this->lines as $line) {
|
||||
//Line extrafield
|
||||
$line->fetch_optionals();
|
||||
|
|
@ -5271,7 +5271,7 @@ abstract class CommonObject
|
|||
|
||||
$i++;
|
||||
}
|
||||
print "</tbody><!-- end printObjectLines() -->\n";
|
||||
print "<!-- end printObjectLines() -->\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -963,7 +963,8 @@ class ExtraFields
|
|||
* @param string $elementtype Type of element ('all' = all or $object->table_element like 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
|
||||
* @param boolean $forceload Force load of extra fields whatever is status of cache.
|
||||
* @param string $attrname The name of the attribute.
|
||||
* @return array{}|array{label:array<string,string>,type:array<string,string>,size:array<string,string>,default:array<string,string>,computed:array<string,string>,unique:array<string,int>,required:array<string,int>,param:array<string,mixed>,perms:array<string,mixed[]>,list:array<string,int>|array<string,string>,pos:array<string,int>,totalizable:array<string,int>,help:array<string,string>,printable:array<string,int>,enabled:array<string,int>,langfile:array<string,string>,css:array<string,string>,csslist:array<string,string>,hidden:array<string,int>,mandatoryfieldsofotherentities?:array<string,string>,loaded?:int,count:int} Array of attributes keys+label for all extra fields. Note: count set as present to avoid static analysis notices
|
||||
* @return array<string,string> Array of attributes keys+label for all extra fields.
|
||||
* in addition $this->attributes will be completed with array{label:array<string,string>,type:array<string,string>,size:array<string,string>,default:array<string,string>,computed:array<string,string>,unique:array<string,int>,required:array<string,int>,param:array<string,mixed>,perms:array<string,mixed[]>,list:array<string,int>|array<string,string>,pos:array<string,int>,totalizable:array<string,int>,help:array<string,string>,printable:array<string,int>,enabled:array<string,int>,langfile:array<string,string>,css:array<string,string>,csslist:array<string,string>,hidden:array<string,int>,mandatoryfieldsofotherentities?:array<string,string>,loaded?:int,count:int} Note: count set as present to avoid static analysis notices
|
||||
*/
|
||||
public function fetch_name_optionals_label($elementtype, $forceload = false, $attrname = '')
|
||||
{
|
||||
|
|
@ -1953,16 +1954,17 @@ class ExtraFields
|
|||
/**
|
||||
* Return HTML string to put an output field into a page
|
||||
*
|
||||
* @param string $key Key of attribute
|
||||
* @param string $value Value to show
|
||||
* @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering)
|
||||
* @param string $extrafieldsobjectkey Required (for example $object->table_element).
|
||||
* @param Translate $outputlangs Output language
|
||||
* @return string Formatted value
|
||||
* @param string $key Key of attribute
|
||||
* @param string $value Value to show
|
||||
* @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering)
|
||||
* @param string $extrafieldsobjectkey Required (for example $object->table_element).
|
||||
* @param Translate $outputlangs Output
|
||||
* @param object $object The parent object of field to show
|
||||
* @return string Formatted value
|
||||
*/
|
||||
public function showOutputField($key, $value, $moreparam = '', $extrafieldsobjectkey = '', $outputlangs = null)
|
||||
public function showOutputField($key, $value, $moreparam = '', $extrafieldsobjectkey = '', $outputlangs = null, $object = null)
|
||||
{
|
||||
global $conf, $langs, $object;
|
||||
global $conf, $langs;
|
||||
|
||||
if (is_null($outputlangs) || !is_object($outputlangs)) {
|
||||
$outputlangs = $langs;
|
||||
|
|
@ -2288,10 +2290,10 @@ class ExtraFields
|
|||
if (!empty($classpath)) {
|
||||
dol_include_once($InfoFieldList[1]);
|
||||
if ($classname && class_exists($classname)) {
|
||||
$object = new $classname($this->db);
|
||||
'@phan-var-force CommonObject $object';
|
||||
$object->fetch($value);
|
||||
$value = $object->getNomUrl(3);
|
||||
$tmpobject = new $classname($this->db);
|
||||
'@phan-var-force CommonObject $tmpobject';
|
||||
$tmpobject->fetch($value);
|
||||
$value = $tmpobject->getNomUrl(3);
|
||||
}
|
||||
} else {
|
||||
dol_syslog('Error bad setup of extrafield', LOG_WARNING);
|
||||
|
|
@ -2321,8 +2323,9 @@ class ExtraFields
|
|||
} elseif ($type == 'password') {
|
||||
$value = dol_trunc(preg_replace('/./i', '*', $value), 8, 'right', 'UTF-8', 1);
|
||||
} elseif ($type == 'stars') {
|
||||
$value = '<input type="hidden" class="flat" name="'.$key.'" id="'.$key.$object->id.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').'>';
|
||||
$value .= '<div class="star-selection" id="'.$key.$object->id.'_selection">';
|
||||
$objectid = (int) $object->id;
|
||||
$value = '<input type="hidden" class="flat" name="'.$key.'" id="'.$key.$objectid.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').'>';
|
||||
$value .= '<div class="star-selection" id="'.$key.$objectid.'_selection">';
|
||||
$i = 1;
|
||||
while ($i <= $size) {
|
||||
$value .= '<span class="star" data-value="'.$i.'">'.img_picto('', 'fontawesome_star_fas').'</span>';
|
||||
|
|
@ -2331,8 +2334,8 @@ class ExtraFields
|
|||
$value .= '</div>';
|
||||
$value .= '<script>
|
||||
$(document).ready(function() {
|
||||
let container = $("#'.$key.$object->id.'_selection");
|
||||
let selectedStars = parseInt($("#'.$key.$object->id.'").val()) || 0;
|
||||
let container = $("#'.$key.$objectid.'_selection");
|
||||
let selectedStars = parseInt($("#'.$key.$objectid.'").val()) || 0;
|
||||
container.find(".star").each(function() {
|
||||
$(this).toggleClass("active", $(this).data("value") <= selectedStars);
|
||||
});
|
||||
|
|
@ -2349,10 +2352,10 @@ class ExtraFields
|
|||
});
|
||||
container.find(".star").off("click").on("click", function() {
|
||||
selectedStars = $(this).data("value");
|
||||
if (selectedStars == 1 && $("#'.$key.$object->id.'").val() == 1) {
|
||||
if (selectedStars == 1 && $("#'.$key.$objectid.'").val() == 1) {
|
||||
selectedStars = 0;
|
||||
}
|
||||
container.find("#'.$key.$object->id.'").val(selectedStars);
|
||||
container.find("#'.$key.$objectid.'").val(selectedStars);
|
||||
container.find(".star").each(function() {
|
||||
$(this).toggleClass("active", $(this).data("value") <= selectedStars);
|
||||
});
|
||||
|
|
@ -2360,9 +2363,9 @@ class ExtraFields
|
|||
url: "'.DOL_URL_ROOT.'/core/ajax/editextrafield.php",
|
||||
method: "POST",
|
||||
data: {
|
||||
objectType: "'.$extrafieldsobjectkey.'",
|
||||
objectId: "'.$object->id.'",
|
||||
field: "'.$key.'",
|
||||
objectType: \''.dol_escape_js($extrafieldsobjectkey).'\',
|
||||
objectId: '.((int) $objectid).',
|
||||
field: \''.dol_escape_js($key).'\',
|
||||
value: selectedStars,
|
||||
token: "'.newToken().'"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9293,7 +9293,7 @@ class Form
|
|||
<dd class="dropdowndd">
|
||||
<div class="multiselectcheckbox'.$htmlname.'">
|
||||
<ul class="'.$htmlname.($pos == '1' ? 'left' : '').'">
|
||||
<li><input class="inputsearch_dropdownselectedfields width90p minwidth200imp" style="width:90%;" type="text" placeholder="'.$langs->trans('Search').'"></li>
|
||||
<li class="liinputsearch"><input class="inputsearch_dropdownselectedfields width90p minwidth200imp" style="width:90%;" type="text" placeholder="'.$langs->trans('Search').'"></li>
|
||||
'.$listoffieldsforselection.'
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -383,13 +383,6 @@ class FormActions
|
|||
|
||||
// Suggest a list with manual events or all auto events
|
||||
$arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot, '', 0); // If we use param 'all' instead of 'code', there is no group by include in answer but the key 'type' of answer array contains the key for the group by.
|
||||
/* Removed. The empty line must now be managed with param showempty
|
||||
if (empty($multiselect)) {
|
||||
// Add empty line at start only if no multiselect
|
||||
array_unshift($arraylist, ' ');
|
||||
}
|
||||
*/
|
||||
//asort($arraylist);
|
||||
|
||||
if ($selected == 'manual') {
|
||||
$selected = 'AC_OTH';
|
||||
|
|
@ -411,6 +404,7 @@ class FormActions
|
|||
if (strpos($key, 'AC_ALL_') !== false && strpos($key, 'AC_ALL_AUTO') === false) {
|
||||
$disabled = 'disabled';
|
||||
}
|
||||
|
||||
$newarraylist[$key] = array('id' => $key, 'label' => $value, 'disabled' => $disabled);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -176,7 +176,9 @@ class FormFile
|
|||
$out .= ' ';
|
||||
if ($sectionid) { // Show overwrite if exists for ECM module only
|
||||
$langs->load('link');
|
||||
$out .= '<span class="nowraponsmartphone"><input style="margin-right: 2px;" type="checkbox" id="overwritefile" name="overwritefile" value="1"><label for="overwritefile">'.$langs->trans("OverwriteIfExists").'</label></span>';
|
||||
$out .= '<span class="nowraponsmartphone"><input style="margin-right: 2px;" type="checkbox" id="overwritefile" name="overwritefile" value="1">';
|
||||
$out .= '<label for="overwritefile" class="opacitylow paddingright">'.$langs->trans("OverwriteIfExists").'</label>';
|
||||
$out .= '</span>';
|
||||
}
|
||||
$out .= '<input type="submit" class="button small reposition" name="sendit" value="'.$langs->trans("Upload").'"';
|
||||
$out .= (!getDolGlobalString('MAIN_UPLOAD_DOC') || empty($perm) ? ' disabled' : '');
|
||||
|
|
@ -192,7 +194,7 @@ class FormFile
|
|||
$menudolibarrsetupmax = $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Security");
|
||||
$langs->load('other');
|
||||
$out .= ' ';
|
||||
$out .= info_admin($langs->trans("ThisLimitIsDefinedInSetupAt", $menudolibarrsetupmax, $max, $maxphptoshowparam, $maxphptoshow), 1);
|
||||
$out .= info_admin($langs->trans("ThisLimitIsDefinedInSetupAt", $menudolibarrsetupmax, $max, $maxphptoshowparam, $maxphptoshow), 1, 0, '1', 'classfortooltip');
|
||||
}
|
||||
} else {
|
||||
$out .= ' ('.$langs->trans("UploadDisabled").')';
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ class FormProjets extends Form
|
|||
// Use select2 selector
|
||||
if (empty($option_only) && !empty($conf->use_javascript_ajax)) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
|
||||
$comboenhancement = ajax_combobox($htmlname, [], 0, $forcefocus);
|
||||
$out .= $comboenhancement;
|
||||
$morecss .= ' minwidth150imp';
|
||||
}
|
||||
|
|
@ -906,7 +906,7 @@ class FormProjets extends Form
|
|||
if (empty($lineOnly)) {
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$comboenhancement = ajax_combobox($htmlNameInvoiceLine, '', 0, 0);
|
||||
$comboenhancement = ajax_combobox($htmlNameInvoiceLine, [], 0, 0);
|
||||
$out .= $comboenhancement;
|
||||
$morecss = 'minwidth200imp maxwidth500';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -262,6 +262,7 @@ class DoliDBMysqli extends DoliDB
|
|||
try {
|
||||
if (!class_exists('mysqli')) {
|
||||
dol_print_error(null, 'Driver mysqli for PHP not available');
|
||||
return false;
|
||||
}
|
||||
if (strpos($host, 'ssl://') === 0) {
|
||||
$tmp = new mysqliDoli($host, $login, $passwd, $name, $port);
|
||||
|
|
@ -1289,38 +1290,41 @@ class DoliDBMysqli extends DoliDB
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to make SSL connection
|
||||
*/
|
||||
class mysqliDoli extends mysqli
|
||||
{
|
||||
|
||||
if (class_exists('myslqi')) {
|
||||
/**
|
||||
* Constructor.
|
||||
* This create an opened connection to a database server and eventually to a database
|
||||
*
|
||||
* @param string $host Address of database server
|
||||
* @param string $user Name of database user
|
||||
* @param string $pass Password of database user
|
||||
* @param string $name Name of database
|
||||
* @param int $port Port of database server
|
||||
* @param string $socket Socket
|
||||
* Class to make SSL connection
|
||||
*/
|
||||
public function __construct($host, $user, $pass, $name, $port = 0, $socket = "")
|
||||
class mysqliDoli extends mysqli
|
||||
{
|
||||
$flags = 0;
|
||||
if (PHP_VERSION_ID >= 80100) {
|
||||
parent::__construct();
|
||||
} else {
|
||||
// @phan-suppress-next-line PhanDeprecatedFunctionInternal
|
||||
parent::init();
|
||||
/**
|
||||
* Constructor.
|
||||
* This create an opened connection to a database server and eventually to a database
|
||||
*
|
||||
* @param string $host Address of database server
|
||||
* @param string $user Name of database user
|
||||
* @param string $pass Password of database user
|
||||
* @param string $name Name of database
|
||||
* @param int $port Port of database server
|
||||
* @param string $socket Socket
|
||||
*/
|
||||
public function __construct($host, $user, $pass, $name, $port = 0, $socket = "")
|
||||
{
|
||||
$flags = 0;
|
||||
if (PHP_VERSION_ID >= 80100) {
|
||||
parent::__construct();
|
||||
} else {
|
||||
// @phan-suppress-next-line PhanDeprecatedFunctionInternal
|
||||
parent::init();
|
||||
}
|
||||
if (strpos($host, 'ssl://') === 0) {
|
||||
$host = substr($host, 6);
|
||||
parent::options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, false);
|
||||
// Suppress false positive @phan-suppress-next-line PhanTypeMismatchArgumentInternalProbablyReal
|
||||
parent::ssl_set(null, null, "", null, null);
|
||||
$flags = MYSQLI_CLIENT_SSL;
|
||||
}
|
||||
parent::real_connect($host, $user, $pass, $name, $port, $socket, $flags);
|
||||
}
|
||||
if (strpos($host, 'ssl://') === 0) {
|
||||
$host = substr($host, 6);
|
||||
parent::options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, false);
|
||||
// Suppress false positive @phan-suppress-next-line PhanTypeMismatchArgumentInternalProbablyReal
|
||||
parent::ssl_set(null, null, "", null, null);
|
||||
$flags = MYSQLI_CLIENT_SSL;
|
||||
}
|
||||
parent::real_connect($host, $user, $pass, $name, $port, $socket, $flags);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ function print_actions_filter(
|
|||
$multiselect = (getDolGlobalString('AGENDA_USE_EVENT_TYPE'));
|
||||
}
|
||||
print img_picto($langs->trans("ActionType"), 'square', 'class="pictofixedwidth inline-block" style="color: #ddd;"');
|
||||
print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? -1 : 1), 0, $multiselect, 0, 'minwidth200 maxwidth250 widthcentpercentminusx', 1);
|
||||
print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? -1 : 1), 0, $multiselect, 0, 'minwidth150 maxwidth200 widthcentpercentminusx', 1);
|
||||
print '</div>';
|
||||
|
||||
if ($canedit) {
|
||||
|
|
|
|||
|
|
@ -445,7 +445,7 @@ function ajax_dialog($title, $message, $w = 350, $h = 150)
|
|||
* TODO: It is used when COMPANY_USE_SEARCH_TO_SELECT and CONTACT_USE_SEARCH_TO_SELECT are set by html.formcompany.class.php. Should use ajax_autocompleter instead like done by html.form.class.php for select_produits.
|
||||
*
|
||||
* @param string $htmlname Name of html select field ('myid' or '.myclass')
|
||||
* @param array<array{method:string,url:string,htmlname:string,params:array<string,string>}> $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @param array<array{method:string,url:string,htmlname:string,params?:array<string,string>}> $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete
|
||||
* @param int $forcefocus Force focus on field
|
||||
* @param string $widthTypeOfAutocomplete 'resolve' or 'off'
|
||||
|
|
|
|||
|
|
@ -6348,7 +6348,7 @@ function print_fiche_titre($title, $mesg = '', $picto = 'generic', $pictoisfullp
|
|||
* @param string $title Title to show (HTML sanitized content)
|
||||
* @param string $morehtmlright Added message to show on right
|
||||
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
|
||||
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
|
||||
* @param int<0,1> $pictoisfullpath 1=Icon name is a full absolute url of image
|
||||
* @param string $id To force an id on html objects
|
||||
* @param string $morecssontable More css on table
|
||||
* @param string $morehtmlcenter Added message to show on center
|
||||
|
|
@ -6451,7 +6451,7 @@ function print_barre_liste($title, $page, $file, $options = '', $sortfield = '',
|
|||
print '<td class="nobordernopadding valignmiddle col-title">';
|
||||
print '<div class="titre inline-block">';
|
||||
print '<span class="inline-block valignmiddle print-barre-liste">'.$title.'</span>'; // $title may contains HTML like a combo list from page consumption.php, so we do not use dolPrintLabel here()
|
||||
if (!empty($title) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') {
|
||||
if (!empty($title) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '' && $totalnboflines > 0) {
|
||||
print '<span class="opacitymedium colorblack marginleftonly totalnboflines valignmiddle" title="'.$langs->trans("NbRecordQualified").'">('.$totalnboflines.')</span>';
|
||||
}
|
||||
print '</div></td>';
|
||||
|
|
@ -6584,8 +6584,9 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be
|
|||
if (empty($hidenavigation)) {
|
||||
if ((int) $limit > 0 && (empty($selectlimitsuffix) || !is_numeric($selectlimitsuffix))) {
|
||||
$pagesizechoices = '10:10,15:15,20:20,25:25,50:50,100:100,250:250,500:500,1000:1000';
|
||||
$pagesizechoices .= ',5000:5000,10000:10000';
|
||||
//$pagesizechoices .= ',20000:20000'; // Memory trouble on browsers
|
||||
$pagesizechoices .= ',5000:5000';
|
||||
//$pagesizechoices .= ',10000:10000'; // Memory trouble on most browsers
|
||||
//$pagesizechoices .= ',20000:20000'; // Memory trouble on most browsers
|
||||
//$pagesizechoices .= ',0:'.$langs->trans("All"); // Not yet supported
|
||||
//$pagesizechoices .= ',2:2';
|
||||
if (getDolGlobalString('MAIN_PAGESIZE_CHOICES')) {
|
||||
|
|
@ -6598,16 +6599,16 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be
|
|||
print '<datalist id="limitlist">';
|
||||
} else {
|
||||
print '<li class="paginationcombolimit valignmiddle">';
|
||||
print '<select id="limit'.(is_numeric($selectlimitsuffix) ? '': $selectlimitsuffix).'" name="limit" class="flat selectlimit nopadding maxwidth75 center'.(is_numeric($selectlimitsuffix) ? '': ' '.$selectlimitsuffix).'" title="'.dol_escape_htmltag($langs->trans("MaxNbOfRecordPerPage")).'">';
|
||||
print '<select id="limit'.(is_numeric($selectlimitsuffix) ? '' : $selectlimitsuffix).'" name="limit" class="flat selectlimit nopadding maxwidth75 center'.(is_numeric($selectlimitsuffix) ? '' : ' '.$selectlimitsuffix).'" title="'.dol_escape_htmltag($langs->trans("MaxNbOfRecordPerPage")).'">';
|
||||
}
|
||||
$tmpchoice = explode(',', $pagesizechoices);
|
||||
$tmpkey = $limit.':'.$limit;
|
||||
if (!in_array($tmpkey, $tmpchoice)) {
|
||||
$tmpchoice[] = $tmpkey;
|
||||
$tmpchoice[$tmpkey] = $tmpkey;
|
||||
}
|
||||
$tmpkey = $conf->liste_limit.':'.$conf->liste_limit;
|
||||
if (!in_array($tmpkey, $tmpchoice)) {
|
||||
$tmpchoice[] = $tmpkey;
|
||||
$tmpchoice[$tmpkey] = $tmpkey;
|
||||
}
|
||||
asort($tmpchoice, SORT_NUMERIC);
|
||||
foreach ($tmpchoice as $val) {
|
||||
|
|
@ -6626,7 +6627,7 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be
|
|||
print '</datalist>';
|
||||
} else {
|
||||
print '</select>';
|
||||
print ajax_combobox("limit".(is_numeric($selectlimitsuffix) ? '': $selectlimitsuffix), array(), 0, 0, 'resolve', '-1', 'limit');
|
||||
print ajax_combobox("limit".(is_numeric($selectlimitsuffix) ? '' : $selectlimitsuffix), array(), 0, 0, 'resolve', '-1', 'limit');
|
||||
//print ajax_combobox("limit");
|
||||
}
|
||||
|
||||
|
|
@ -9468,6 +9469,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||
$substitutionarray['__AMOUNT_MULTICURRENCY__'] = (is_object($object) && isset($object->multicurrency_total_ttc)) ? $object->multicurrency_total_ttc : '';
|
||||
$substitutionarray['__AMOUNT_MULTICURRENCY_TEXT__'] = (is_object($object) && isset($object->multicurrency_total_ttc)) ? dol_convertToWord($object->multicurrency_total_ttc, $outputlangs, '', true) : '';
|
||||
$substitutionarray['__AMOUNT_MULTICURRENCY_TEXTCURRENCY__'] = (is_object($object) && isset($object->multicurrency_total_ttc)) ? dol_convertToWord($object->multicurrency_total_ttc, $outputlangs, $object->multicurrency_code, true) : '';
|
||||
$substitutionarray['__MULTICURRENCY_CODE__'] = (is_object($object) && isset($object->multicurrency_code)) ? $object->multicurrency_code : '';
|
||||
// TODO Add other keys for foreign multicurrency
|
||||
|
||||
// For backward compatibility
|
||||
|
|
@ -10573,7 +10575,8 @@ function dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1'
|
|||
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST', 'ReflectionFunction'));
|
||||
|
||||
$forbiddenphpfunctions = array();
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("base64_decode", "rawurldecode", "urldecode", "str_rot13", "hex2bin")); // decode string functions used to obfuscated function name
|
||||
// @phpcs:ignore
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("base64"."_"."decode", "rawurl"."decode", "url"."decode", "str"."_rot13", "hex"."2bin")); // name of forbidden functions are split to avoid false positive
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("override_function", "session_id", "session_create_id", "session_regenerate_id"));
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes"));
|
||||
|
|
@ -13300,6 +13303,7 @@ function fetchObjectByElement($element_id, $element_type, $element_ref = '', $us
|
|||
return $objecttmp; // returned an object without fetch
|
||||
}
|
||||
} else {
|
||||
dol_syslog($element_prop['classname'].' doesn\'t exists in /'.$element_prop['classpath'].'/'.$element_prop['classfile'].'.class.php');
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1369,7 +1369,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
|
|||
if ($bentityon) { // only if entity enable
|
||||
$maskrefclient_sql .= " AND entity IN (".getEntity($sharetable).")";
|
||||
} elseif (!empty($forceentity)) {
|
||||
$sql .= " AND entity IN (".$db->sanitize($forceentity).")";
|
||||
$maskrefclient_sql .= " AND entity IN (".$db->sanitize($forceentity).")";
|
||||
}
|
||||
if ($where) {
|
||||
$maskrefclient_sql .= $where; //use the same optional where as general mask
|
||||
|
|
|
|||
|
|
@ -262,6 +262,11 @@ function invoice_rec_prepare_head($object)
|
|||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT . '/compta/facture/list.php?search_fk_fac_rec_source=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('InvoicesGeneratedFromRec');
|
||||
$head[$h][2] = 'generated';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/agenda-rec.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Events");
|
||||
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
|
||||
|
|
@ -310,7 +315,7 @@ function invoice_rec_prepare_head($object)
|
|||
/**
|
||||
* Return array head with list of tabs to view object information.
|
||||
*
|
||||
* @param Facture $object Invoice object
|
||||
* @param FactureFournisseurRec $object Invoice object
|
||||
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
|
||||
*/
|
||||
function supplier_invoice_rec_prepare_head($object)
|
||||
|
|
@ -325,6 +330,11 @@ function supplier_invoice_rec_prepare_head($object)
|
|||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT . '/fourn/facture/list.php?search_fk_fac_rec_source=' . $object->id;
|
||||
$head[$h][1] = $langs->trans('InvoicesGeneratedFromRec');
|
||||
$head[$h][2] = 'generated';
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
|
|
|
|||
|
|
@ -2541,10 +2541,12 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
|
|||
|
||||
if (count($objects) > 1) {
|
||||
$order = null;
|
||||
|
||||
$refListsTxt = '';
|
||||
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') {
|
||||
$object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :');
|
||||
$refListsTxt.= $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' :';
|
||||
} else {
|
||||
$object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities("RefSending").' :');
|
||||
$refListsTxt.=$outputlangs->transnoentities("RefSending").' :';
|
||||
}
|
||||
// We concat this record info into fields xxx_value. title is overwrote.
|
||||
foreach ($objects as $elementobject) {
|
||||
|
|
@ -2559,14 +2561,16 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$refListsTxt.= (!empty($refListsTxt)?' ':'');
|
||||
if (! is_object($order)) {
|
||||
$object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref));
|
||||
$refListsTxt.= $outputlangs->transnoentities($elementobject->ref);
|
||||
} else {
|
||||
$object->note_public = dol_concatdesc($object->note_public, $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''));
|
||||
$object->note_public = dol_concatdesc($object->note_public, ' / '.$outputlangs->transnoentities($elementobject->ref));
|
||||
$refListsTxt.= $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : '');
|
||||
$refListsTxt.= ' / '.$outputlangs->transnoentities($elementobject->ref);
|
||||
}
|
||||
}
|
||||
|
||||
$object->note_public = dol_concatdesc($object->note_public, $refListsTxt);
|
||||
} elseif (count($objects) == 1) {
|
||||
$elementobject = array_shift($objects);
|
||||
$order = null;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright (C) 2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024 Jean-Rémi TAPONIER <jean-remi@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Mélina Joum <melina.joum@altairis.fr>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -331,6 +332,8 @@ function product_admin_prepare_head()
|
|||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extrafields->fetch_name_optionals_label('product');
|
||||
$extrafields->fetch_name_optionals_label('product_price');
|
||||
$extrafields->fetch_name_optionals_label('product_customer_price');
|
||||
$extrafields->fetch_name_optionals_label('product_fournisseur_price');
|
||||
|
||||
$h = 0;
|
||||
|
|
@ -365,6 +368,24 @@ function product_admin_prepare_head()
|
|||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/admin/product_price_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ProductLevelExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['product_price']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'levelAttributes';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/admin/product_customer_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ProductCustomerExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['product_customer_price']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'customerAttributes';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/product/admin/product_supplier_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ProductSupplierExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['product_fournisseur_price']['count'];
|
||||
|
|
|
|||
|
|
@ -560,11 +560,9 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||
print '<td>'.$langs->trans("TopMenuDisableImages").'</td>';
|
||||
print '<td colspan="'.($colspan - 1).'">';
|
||||
if ($edit) {
|
||||
//print ajax_constantonoff('THEME_TOPMENU_DISABLE_IMAGE', array(), null, 0, 0, 1);
|
||||
print $form->selectarray('THEME_TOPMENU_DISABLE_IMAGE', $listoftopmenumodes, isset($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? $conf->global->THEME_TOPMENU_DISABLE_IMAGE : 0, 0, 0, 0, '', 0, 0, 0, '', 'widthcentpercentminusx maxwidth500');
|
||||
print $form->selectarray('THEME_TOPMENU_DISABLE_IMAGE', $listoftopmenumodes, getDolGlobalInt('THEME_TOPMENU_DISABLE_IMAGE'), 0, 0, 0, '', 0, 0, 0, '', 'widthcentpercentminusx maxwidth500');
|
||||
} else {
|
||||
print $listoftopmenumodes[getDolGlobalInt('THEME_TOPMENU_DISABLE_IMAGE')];
|
||||
//print yn($conf->global->THEME_TOPMENU_DISABLE_IMAGE);
|
||||
}
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes"));
|
||||
print '</td>';
|
||||
|
|
@ -614,7 +612,6 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||
print '<td colspan="'.($colspan - 1).'" class="valignmiddle">';
|
||||
if ($edit) {
|
||||
print ajax_constantonoff('THEME_ELDY_USEBORDERONTABLE', array(), null, 0, 0, 1, 2, 0, 1);
|
||||
//print $form->selectyesno('THEME_ELDY_USEBORDERONTABLE', $conf->global->THEME_ELDY_USEBORDERONTABLE, 1);
|
||||
} else {
|
||||
print yn(getDolGlobalString('THEME_ELDY_USEBORDERONTABLE'));
|
||||
}
|
||||
|
|
@ -623,6 +620,31 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($foruserprofile) {
|
||||
} else {
|
||||
if (getDolGlobalString('THEME_ELDY_USEBORDERONTABLE')) {
|
||||
$listofborderradius = array(
|
||||
0 => $langs->transnoentitiesnoconv("No"),
|
||||
4 => $langs->transnoentitiesnoconv("Size").' 4',
|
||||
6 => $langs->transnoentitiesnoconv("Size").' 6',
|
||||
8 => $langs->transnoentitiesnoconv("Size").' 8',
|
||||
10 => $langs->transnoentitiesnoconv("Size").' 10',
|
||||
20 => $langs->transnoentitiesnoconv("Size").' 20',
|
||||
);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("RoundBorders").'</td>';
|
||||
print '<td colspan="'.($colspan - 1).'" class="valignmiddle">';
|
||||
if ($edit) {
|
||||
print $form->selectarray('THEME_ELDY_BORDER_RADIUS', $listofborderradius, getDolGlobalInt('THEME_ELDY_BORDER_RADIUS'), 0, 0, 0, '', 0, 0, 0, '', 'widthcentpercentminusx maxwidth100');
|
||||
} else {
|
||||
print $listofborderradius[getDolGlobalInt('THEME_ELDY_BORDER_RADIUS')];
|
||||
}
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes"), 1, 'help', 'inline-block');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
// Table line height
|
||||
/* removed. height of column must use padding of td and not lineheight that has bad side effect
|
||||
if ($foruserprofile) {
|
||||
|
|
|
|||
|
|
@ -2706,6 +2706,67 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for module compliance with Dolibarr rules and law
|
||||
* If a module is reported by this function,it is surely a malware. Delete it as soon as possible.
|
||||
*
|
||||
* @param string $nametocheck Name to check
|
||||
* @return int|string Return integer <0 if Error, 0 == not compliant, 'string' with message if module not compliant
|
||||
*/
|
||||
public function checkForCompliance($nametocheck = '')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if (empty($nametocheck)) {
|
||||
$nametocheck = $this->name;
|
||||
}
|
||||
|
||||
// Get list of illegal modules name or ID
|
||||
if (empty($conf->cache['noncompliantmodules'])) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||
|
||||
$urlforblacklistmodules = 'https://ping.dolibarr.org/modules-blacklist.txt';
|
||||
|
||||
$result = getURLContent($urlforblacklistmodules, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only
|
||||
if (isset($result['content']) && $result['http_code'] == 200) {
|
||||
$langs->load("errors");
|
||||
|
||||
// Security warning : be careful with remote data content, the module editor could be hacked (or evil) so limit to a-z A-Z 0-9 _ . -
|
||||
$arrayoflines = preg_split("/[\n,]/", $result['content']);
|
||||
foreach ($arrayoflines as $line) {
|
||||
$tmpfieldsofline = explode(';', $line);
|
||||
$modulekey = strtolower($tmpfieldsofline[0]);
|
||||
$conf->cache['noncompliantmodules'][$modulekey]['name'] = $tmpfieldsofline[0];
|
||||
$conf->cache['noncompliantmodules'][$modulekey]['id'] = $tmpfieldsofline[1];
|
||||
$conf->cache['noncompliantmodules'][$modulekey]['signature'] = $tmpfieldsofline[2];
|
||||
$conf->cache['noncompliantmodules'][$modulekey]['message'] = $langs->trans(empty($tmpfieldsofline[3]) ? 'WarningModuleAffiliatedToAReportedCompany' : $tmpfieldsofline[3]);
|
||||
if (!empty($tmpfieldsofline[4])) {
|
||||
$message2 = $langs->trans("WarningModuleAffiliatedToAPiratPlatform", '{s}');
|
||||
$listofillegalurl = '';
|
||||
foreach (explode(" ", $tmpfieldsofline[4]) as $illegalurl) {
|
||||
$listofillegalurl .= ($listofillegalurl ? ' '.$langs->trans("or").' ' : '').'<b>'.preg_replace('/[^a-z0-9\.\-]/', '', $illegalurl).'</b>';
|
||||
}
|
||||
$message2 = str_replace('{s}', $listofillegalurl, $message2);
|
||||
$conf->cache['noncompliantmodules'][$modulekey]['message2'] = $message2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->cache['noncompliantmodules'])) {
|
||||
$modulekey = strtolower($nametocheck);
|
||||
if (in_array($modulekey, array_keys($conf->cache['noncompliantmodules']))) {
|
||||
$answer = trim($conf->cache['noncompliantmodules'][$modulekey]['message']);
|
||||
if (!empty($conf->cache['noncompliantmodules'][$modulekey]['message2'])) {
|
||||
$answer .= '<br>'.$conf->cache['noncompliantmodules'][$modulekey]['message2'];
|
||||
}
|
||||
return $answer;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to declare dictionaries one at a time (rather than declaring dictionaries property by property).
|
||||
*
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
|||
|
||||
$pdf->SetFont('', '', $default_font_size);
|
||||
$pdf->SetXY(10, 32);
|
||||
$pdf->MultiCell(0, 2, $outputlangs->transnoentities("BankAccount"), 0, 'L');
|
||||
$pdf->MultiCell(22, 2, $outputlangs->transnoentities("BankAccount"), 0, 'L');
|
||||
pdf_bank($pdf, $outputlangs, 32, 32, $this->account, 1);
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size);
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
|
|||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bordereau_cheque";
|
||||
$sql .= " WHERE ref like '".$db->escape($this->prefix)."____-%'";
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
$sql .= " AND entity = ".((int) $conf->entity);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
|
|
@ -139,8 +139,8 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
|
|||
return -1;
|
||||
}
|
||||
|
||||
//$date=time();
|
||||
$date = $object->date_bordereau;
|
||||
$date = (empty($object) ? dol_now() : $object->date_bordereau);
|
||||
|
||||
$yymm = dol_print_date($date, "%y%m");
|
||||
|
||||
if ($max >= (pow(10, 4) - 1)) {
|
||||
|
|
@ -150,6 +150,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
|
|||
}
|
||||
|
||||
dol_syslog(__METHOD__." return ".$this->prefix.$yymm."-".$num);
|
||||
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,9 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
|
|||
return 0;
|
||||
}
|
||||
|
||||
$numFinal = get_next_value($db, $mask, 'bordereau_cheque', 'ref', '', $objsoc, empty($object) ? dol_now() : $object->date_bordereau);
|
||||
$date = (empty($object) ? dol_now() : $object->date_bordereau);
|
||||
|
||||
$numFinal = get_next_value($db, $mask, 'bordereau_cheque', 'ref', '', $objsoc, $date);
|
||||
|
||||
return $numFinal;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Nick Fragoulis
|
||||
* Copyright (C) 2024 Joachim Kueter <git-jk@bloxera.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -565,10 +566,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
$posYAfterImage = 0;
|
||||
$posYAfterDescription = 0;
|
||||
|
||||
if ($this->getColumnStatus('position')) {
|
||||
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
|
||||
}
|
||||
|
||||
if ($this->getColumnStatus('photo')) {
|
||||
// We start with Photo of product line
|
||||
if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // If photo too high, we moved completely on new page
|
||||
|
|
@ -652,6 +649,11 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
|
||||
|
||||
// # of line
|
||||
if ($this->getColumnStatus('position')) {
|
||||
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
|
||||
}
|
||||
|
||||
// VAT Rate
|
||||
if ($this->getColumnStatus('vat')) {
|
||||
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
|
||||
|
|
@ -1723,7 +1725,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
$idaddressshipping = $object->getIdContact('external', 'SHIPPING');
|
||||
|
||||
if (!empty($idaddressshipping)) {
|
||||
$contactshipping = $object->fetch_Contact($idaddressshipping[0]);
|
||||
$contactshipping = $object->fetch_contact($idaddressshipping[0]);
|
||||
$companystatic = new Societe($this->db);
|
||||
$companystatic->fetch($object->contact->fk_soc);
|
||||
$carac_client_name_shipping = pdfBuildThirdpartyName($object->contact, $outputlangs);
|
||||
|
|
@ -1898,7 +1900,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||
'border-left' => true, // add left line separator
|
||||
);
|
||||
|
||||
if (!getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
|
||||
if (!getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') && !getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN')) {
|
||||
$this->cols['vat']['status'] = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -589,10 +589,6 @@ class pdf_espadon extends ModelePdfExpedition
|
|||
$posYAfterDescription = 0;
|
||||
$heightforsignature = 0;
|
||||
|
||||
if ($this->getColumnStatus('position')) {
|
||||
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
|
||||
}
|
||||
|
||||
if ($this->getColumnStatus('photo')) {
|
||||
// We start with Photo of product line
|
||||
if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot))) { // If photo too high, we moved completely on new page
|
||||
|
|
@ -681,8 +677,12 @@ class pdf_espadon extends ModelePdfExpedition
|
|||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
|
||||
|
||||
// weight
|
||||
// # of line
|
||||
if ($this->getColumnStatus('position')) {
|
||||
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
|
||||
}
|
||||
|
||||
// weight
|
||||
$weighttxt = '';
|
||||
if (empty($object->lines[$i]->fk_product_type) && $object->lines[$i]->weight) {
|
||||
$weighttxt = round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuringUnitString(0, "weight", $object->lines[$i]->weight_units, 1);
|
||||
|
|
|
|||
|
|
@ -720,10 +720,6 @@ class pdf_sponge extends ModelePDFFactures
|
|||
$posYAfterImage = 0;
|
||||
$posYAfterDescription = 0;
|
||||
|
||||
if ($this->getColumnStatus('position')) {
|
||||
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
|
||||
}
|
||||
|
||||
if ($this->getColumnStatus('photo')) {
|
||||
// We start with Photo of product line
|
||||
if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - $page_bottom_margin)) { // If photo too high, we moved completely on new page
|
||||
|
|
@ -805,6 +801,11 @@ class pdf_sponge extends ModelePDFFactures
|
|||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
|
||||
|
||||
// # of line
|
||||
if ($this->getColumnStatus('position')) {
|
||||
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
|
||||
}
|
||||
|
||||
// VAT Rate
|
||||
if ($this->getColumnStatus('vat')) {
|
||||
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
|
||||
|
|
|
|||
|
|
@ -1022,7 +1022,7 @@ class pdf_azur extends ModelePDFPropales
|
|||
$posy = $pdf->GetY() + 2;
|
||||
}
|
||||
}
|
||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1) {
|
||||
if (getDolGlobalInt('FACTURE_CHQ_NUMBER') == -1) {
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
$pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0);
|
||||
|
|
@ -1041,8 +1041,8 @@ class pdf_azur extends ModelePDFPropales
|
|||
// If payment mode not forced or forced to VIR, show payment with BAN
|
||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') {
|
||||
if (!empty($object->fk_account) || !empty($object->fk_bank) || getDolGlobalInt('FACTURE_RIB_NUMBER')) {
|
||||
$bankid = (empty($object->fk_account) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account);
|
||||
if (!empty($object->fk_bank)) {
|
||||
$bankid = (empty($object->fk_account) ? getDolGlobalInt('FACTURE_RIB_NUMBER') : $object->fk_account);
|
||||
if (!empty($object->fk_bank) && $object->fk_bank > 0) {
|
||||
$bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank
|
||||
}
|
||||
$account = new Account($this->db);
|
||||
|
|
@ -1522,12 +1522,12 @@ class pdf_azur extends ModelePDFPropales
|
|||
} else {
|
||||
$pdf->SetTextColor(200, 0, 0);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
|
||||
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
|
||||
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
|
||||
}
|
||||
} else {
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
|
||||
$pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1540,7 +1540,7 @@ class pdf_azur extends ModelePDFPropales
|
|||
$pdf->SetTextColor(128, 0, 0);
|
||||
$title .= ' - '.$outputlangs->transnoentities("NotValidated");
|
||||
}
|
||||
$pdf->MultiCell(100, 4, $title, '', 'R');
|
||||
$pdf->MultiCell($w, 4, $title, '', 'R');
|
||||
|
||||
$pdf->SetFont('', 'B', $default_font_size);
|
||||
|
||||
|
|
@ -1558,7 +1558,7 @@ class pdf_azur extends ModelePDFPropales
|
|||
$posy += 4;
|
||||
$pdf->SetXY($posx, $posy);
|
||||
$pdf->SetTextColor(0, 0, 60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R');
|
||||
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R');
|
||||
}
|
||||
|
||||
if (getDolGlobalString('PDF_SHOW_PROJECT_TITLE')) {
|
||||
|
|
@ -1592,18 +1592,18 @@ class pdf_azur extends ModelePDFPropales
|
|||
$posy = $pdf->getY();
|
||||
$pdf->SetXY($posx, $posy);
|
||||
$pdf->SetTextColor(0, 0, 60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DatePropal")." : ".dol_print_date($object->date, $displaydate, false, $outputlangs, true), '', 'R');
|
||||
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("DatePropal")." : ".dol_print_date($object->date, $displaydate, false, $outputlangs, true), '', 'R');
|
||||
|
||||
$posy += 4;
|
||||
$pdf->SetXY($posx, $posy);
|
||||
$pdf->SetTextColor(0, 0, 60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, $displaydate, false, $outputlangs, true), '', 'R');
|
||||
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, $displaydate, false, $outputlangs, true), '', 'R');
|
||||
|
||||
if (!getDolGlobalString('MAIN_PDF_HIDE_CUSTOMER_CODE') && $object->thirdparty->code_client) {
|
||||
$posy += 4;
|
||||
$pdf->SetXY($posx, $posy);
|
||||
$pdf->SetTextColor(0, 0, 60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : ".$outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
|
||||
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("CustomerCode")." : ".$outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
|
||||
}
|
||||
|
||||
// Get contact
|
||||
|
|
@ -1615,7 +1615,7 @@ class pdf_azur extends ModelePDFPropales
|
|||
$posy += 4;
|
||||
$pdf->SetXY($posx, $posy);
|
||||
$pdf->SetTextColor(0, 0, 60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
|
||||
$pdf->MultiCell($w, 3, $outputlangs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1624,7 +1624,7 @@ class pdf_azur extends ModelePDFPropales
|
|||
$top_shift = 0;
|
||||
// Show list of linked objects
|
||||
$current_y = $pdf->getY();
|
||||
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
|
||||
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, 3, 'R', $default_font_size);
|
||||
if ($current_y < $pdf->getY()) {
|
||||
$top_shift = $pdf->getY() - $current_y;
|
||||
}
|
||||
|
|
@ -1764,7 +1764,7 @@ class pdf_azur extends ModelePDFPropales
|
|||
* Show area for the customer to sign
|
||||
*
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param Propal $object Object invoice
|
||||
* @param Propal $object Object proposal
|
||||
* @param int $posy Position depart
|
||||
* @param Translate $outputlangs Object langs
|
||||
* @return int Position pour suite
|
||||
|
|
@ -1785,7 +1785,7 @@ class pdf_azur extends ModelePDFPropales
|
|||
$pdf->SetFont('', '', $default_font_size - 2);
|
||||
$pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities("ProposalCustomerSignature"), 0, 'L', 1);
|
||||
|
||||
$pdf->SetXY($posx, $tab_top + $tab_hl);
|
||||
$pdf->SetXY($posx, $tab_top + $tab_hl + 3);
|
||||
$pdf->MultiCell($largcol, $tab_hl * 3, '', 1, 'R');
|
||||
if (getDolGlobalString('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING')) {
|
||||
// Can be retrieve with getSignatureAppearanceArray()
|
||||
|
|
|
|||
|
|
@ -574,10 +574,6 @@ class pdf_cyan extends ModelePDFPropales
|
|||
$posYAfterImage = 0;
|
||||
$posYAfterDescription = 0;
|
||||
|
||||
if ($this->getColumnStatus('position')) {
|
||||
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
|
||||
}
|
||||
|
||||
if ($this->getColumnStatus('photo')) {
|
||||
// We start with Photo of product line
|
||||
if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot))) { // If photo too high, we moved completely on new page
|
||||
|
|
@ -612,18 +608,18 @@ class pdf_cyan extends ModelePDFPropales
|
|||
$this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc);
|
||||
$pageposafter = $pdf->getPage();
|
||||
|
||||
if ($pageposafter > $pageposbefore) { // There is a pagebreak
|
||||
if ($pageposafter > $pageposbefore) { // There is a pagebreak (not enough space for total+free text+footer)
|
||||
$pdf->rollbackTransaction(true);
|
||||
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it to simple footer, so we can retry as if we have just the simple footer.
|
||||
|
||||
$this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc);
|
||||
|
||||
$pageposafter = $pdf->getPage();
|
||||
$posyafter = $pdf->GetY();
|
||||
//var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
|
||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot))) { // There is no space left for total+free text
|
||||
if ($i == ($nblines - 1)) { // No more lines, and no space left to show total, so we create a new page
|
||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot))) { // There is no space left for total+free text but no page break.
|
||||
if ($i == ($nblines - 1)) { // No more lines, and no space left to show total, so we create a new page manually because no break page was done automatically for the last part.
|
||||
$pdf->AddPage('', '', true);
|
||||
if (!empty($tplidx)) {
|
||||
$pdf->useTemplate($tplidx);
|
||||
|
|
@ -631,7 +627,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||
$pdf->setPage($pageposafter + 1);
|
||||
}
|
||||
} else {
|
||||
// We found a page break
|
||||
// We found a page break that was done automatically and there is ow enough space for total+free text+footer.
|
||||
// Allows data in the first page if description is long enough to break in multiples pages
|
||||
if (getDolGlobalString('MAIN_PDF_DATA_ON_FIRST_PAGE')) {
|
||||
$showpricebeforepagebreak = 1;
|
||||
|
|
@ -652,7 +648,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||
$pdf->setTopMargin($this->marge_haute);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
// We suppose that a too long description or photo were moved completely on next page
|
||||
// We suppose that a too long description or photo were moved completely on next page, so we set the value for $curY and current page that will be used by the following output.
|
||||
if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
|
||||
$pdf->setPage($pageposafter);
|
||||
$curY = $tab_top_newpage;
|
||||
|
|
@ -660,6 +656,11 @@ class pdf_cyan extends ModelePDFPropales
|
|||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // We reposition the default font
|
||||
|
||||
// # of line
|
||||
if ($this->getColumnStatus('position')) {
|
||||
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
|
||||
}
|
||||
|
||||
// VAT Rate
|
||||
if ($this->getColumnStatus('vat')) {
|
||||
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
|
||||
|
|
@ -723,13 +724,13 @@ class pdf_cyan extends ModelePDFPropales
|
|||
}
|
||||
|
||||
$parameters = array(
|
||||
'object' => $object,
|
||||
'i' => $i,
|
||||
'pdf' => & $pdf,
|
||||
'curY' => & $curY,
|
||||
'nexY' => & $nexY,
|
||||
'outputlangs' => $outputlangs,
|
||||
'hidedetails' => $hidedetails
|
||||
'object' => $object,
|
||||
'i' => $i,
|
||||
'pdf' => & $pdf,
|
||||
'curY' => & $curY,
|
||||
'nexY' => & $nexY,
|
||||
'outputlangs' => $outputlangs,
|
||||
'hidedetails' => $hidedetails
|
||||
);
|
||||
$reshook = $hookmanager->executeHooks('printPDFline', $parameters, $this); // Note that $object may have been modified by hook
|
||||
|
||||
|
|
@ -750,13 +751,13 @@ class pdf_cyan extends ModelePDFPropales
|
|||
|
||||
// TODO remise_percent is an obsolete field for object parent
|
||||
/*if ($object->remise_percent) {
|
||||
$tvaligne -= ($tvaligne * $object->remise_percent) / 100;
|
||||
$tvaligne -= ($tvaligne * $object->remise_percent) / 100;
|
||||
}
|
||||
if ($object->remise_percent) {
|
||||
$localtax1ligne -= ($localtax1ligne * $object->remise_percent) / 100;
|
||||
$localtax1ligne -= ($localtax1ligne * $object->remise_percent) / 100;
|
||||
}
|
||||
if ($object->remise_percent) {
|
||||
$localtax2ligne -= ($localtax2ligne * $object->remise_percent) / 100;
|
||||
$localtax2ligne -= ($localtax2ligne * $object->remise_percent) / 100;
|
||||
}*/
|
||||
|
||||
$vatrate = (string) $object->lines[$i]->tva_tx;
|
||||
|
|
@ -1005,7 +1006,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||
}
|
||||
|
||||
$posxval = 52;
|
||||
if (getDolGlobalString('MAIN_PDF_DATE_TEXT')) {
|
||||
if (getDolGlobalString('MAIN_PDF_DELIVERY_DATE_TEXT')) {
|
||||
$displaydate = "daytext";
|
||||
} else {
|
||||
$displaydate = "day";
|
||||
|
|
@ -1139,7 +1140,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||
// If payment mode not forced or forced to VIR, show payment with BAN
|
||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') {
|
||||
if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) {
|
||||
$bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account);
|
||||
$bankid = ($object->fk_account <= 0 ? getDolGlobalInt('FACTURE_RIB_NUMBER') : $object->fk_account);
|
||||
if ($object->fk_bank > 0) {
|
||||
$bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank
|
||||
}
|
||||
|
|
@ -1319,12 +1320,12 @@ class pdf_cyan extends ModelePDFPropales
|
|||
|
||||
foreach ($localtax_rate as $tvakey => $tvaval) {
|
||||
if ($tvakey != 0) { // On affiche pas taux 0
|
||||
//$this->atleastoneratenotnull++;
|
||||
//$this->atleastoneratenotnull++;
|
||||
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
|
||||
$tvacompl = '';
|
||||
$tvacompl = '';
|
||||
if (preg_match('/\*/', $tvakey)) {
|
||||
$tvakey = str_replace('*', '', $tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
|
|
@ -1354,12 +1355,12 @@ class pdf_cyan extends ModelePDFPropales
|
|||
foreach ($localtax_rate as $tvakey => $tvaval) {
|
||||
// retrieve global local tax
|
||||
if ($tvakey != 0) { // On affiche pas taux 0
|
||||
//$this->atleastoneratenotnull++;
|
||||
//$this->atleastoneratenotnull++;
|
||||
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
|
||||
$tvacompl = '';
|
||||
$tvacompl = '';
|
||||
if (preg_match('/\*/', $tvakey)) {
|
||||
$tvakey = str_replace('*', '', $tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
|
|
@ -1367,7 +1368,12 @@ class pdf_cyan extends ModelePDFPropales
|
|||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
|
||||
$totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl;
|
||||
if (getDolGlobalString('PDF_LOCALTAX2_LABEL_IS_CODE_OR_RATE') == 'nocodenorate') {
|
||||
$totalvat .= $tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate((string) abs((float) $tvakey), 1).$tvacompl;
|
||||
}
|
||||
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval);
|
||||
|
|
@ -1410,18 +1416,17 @@ class pdf_cyan extends ModelePDFPropales
|
|||
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0);
|
||||
|
||||
/*
|
||||
if ($object->close_code == 'discount_vat')
|
||||
{
|
||||
$index++;
|
||||
$pdf->SetFillColor(255,255,255);
|
||||
if ($object->close_code == 'discount_vat') {
|
||||
$index++;
|
||||
$pdf->SetFillColor(255,255,255);
|
||||
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', 1);
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', 1);
|
||||
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle, 0, $outputlangs), $useborder, 'R', 1);
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle, 0, $outputlangs), $useborder, 'R', 1);
|
||||
|
||||
$resteapayer=0;
|
||||
$resteapayer=0;
|
||||
}
|
||||
*/
|
||||
|
||||
|
|
@ -1850,7 +1855,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||
$pdf->SetFont('', '', $default_font_size - 2);
|
||||
$pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities("ProposalCustomerSignature"), 0, 'L', 1);
|
||||
|
||||
$pdf->SetXY($posx, $tab_top + $tab_hl);
|
||||
$pdf->SetXY($posx, $tab_top + $tab_hl + 3);
|
||||
$pdf->MultiCell($largcol, $tab_hl * 3, '', 1, 'R');
|
||||
|
||||
if (getDolGlobalString('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING')) {
|
||||
|
|
|
|||
|
|
@ -526,10 +526,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
$posYAfterImage = 0;
|
||||
$posYAfterDescription = 0;
|
||||
|
||||
if ($this->getColumnStatus('position')) {
|
||||
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
|
||||
}
|
||||
|
||||
// We start with Photo of product line
|
||||
if ($this->getColumnStatus('photo')) {
|
||||
// We start with Photo of product line
|
||||
|
|
@ -556,6 +552,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
$posYAfterImage = $curY + $imglinesize['height'];
|
||||
}
|
||||
}
|
||||
|
||||
// Description of product line
|
||||
$curX = $this->posxdesc - 1;
|
||||
$showpricebeforepagebreak = 1;
|
||||
|
|
@ -611,6 +608,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default
|
||||
|
||||
// # of line
|
||||
if ($this->getColumnStatus('position')) {
|
||||
$this->printStdColumnContent($pdf, $curY, 'position', (string) ($i + 1));
|
||||
}
|
||||
|
||||
// VAT Rate
|
||||
if ($this->getColumnStatus('vat')) {
|
||||
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ if (!empty($totalarray['totalizable']) && is_array($totalarray['totalizable']))
|
|||
}
|
||||
// Show total line
|
||||
if (isset($totalarray['pos'])) {
|
||||
print '<tfoot>';
|
||||
//print '<tfoot>';
|
||||
print '<tr class="liste_total">';
|
||||
$i = 0;
|
||||
while ($i < $totalarray['nbfield']) {
|
||||
|
|
@ -86,7 +86,7 @@ if (isset($totalarray['pos'])) {
|
|||
}
|
||||
}
|
||||
}
|
||||
print '</tfoot>';
|
||||
//print '</tfoot>';
|
||||
}
|
||||
|
||||
/** print a total cell value according to its type
|
||||
|
|
|
|||
|
|
@ -40,6 +40,27 @@ if ($size > 10000) {
|
|||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
'
|
||||
@phan-var-force string $captcha_refresh
|
||||
@phan-var-force int<0,1> $dol_hide_leftmenu
|
||||
@phan-var-force int<0,1> $dol_hide_topmenu
|
||||
@phan-var-force int<0,1> $dol_no_mouse_hover
|
||||
@phan-var-force int<0,1> $dol_optimize_smallscreen
|
||||
@phan-var-force int<0,1> $dol_use_jmobile
|
||||
@phan-var-force string $focus_element
|
||||
@phan-var-force string $helpcenterlink
|
||||
@phan-var-force string $login
|
||||
@phan-var-force string $main_authentication
|
||||
@phan-var-force string $main_home
|
||||
@phan-var-force string $password
|
||||
@phan-var-force string $session_name
|
||||
@phan-var-force string $titletruedolibarrversion
|
||||
@phan-var-force string $urllogo
|
||||
|
||||
@phan-var-force int<0,1> $forgetpasslink
|
||||
@phan-var-force int<0,1> $helpcenterlink
|
||||
';
|
||||
|
||||
|
||||
header('Cache-Control: Public, must-revalidate');
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,13 @@ if (empty($object) || !is_object($object)) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
'
|
||||
@phan-var-force Propal|Contrat|Commande|Facture|Expedition|Delivery|FactureFournisseur|FactureFournisseur|SupplierProposal $object
|
||||
@phan-var-force PropaleLigne|ContratLigne|CommonObjectLine|CommonInvoiceLine|CommonOrderLine|ExpeditionLigne|DeliveryLine|FactureFournisseurLigneRec|SupplierInvoiceLine|SupplierProposalLine $line
|
||||
@phan-var-force ThirdParty $seller
|
||||
@phan-var-force ThirdParty $buyer
|
||||
@phan-var-force string $var
|
||||
';
|
||||
|
||||
$usemargins = 0;
|
||||
if (isModEnabled('margin') && !empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande'))) {
|
||||
|
|
@ -208,6 +215,7 @@ $coldisplay++;
|
|||
|
||||
// VAT Rate
|
||||
$coldisplay++;
|
||||
$type_tva = null;
|
||||
if ($object->element == 'propal' || $object->element == 'commande' || $object->element == 'facture' || $object->element == 'facturerec') {
|
||||
$type_tva = 1;
|
||||
} elseif ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier' || $object->element == 'invoice_supplier_rec') {
|
||||
|
|
@ -369,6 +377,8 @@ $coldisplay++;
|
|||
<td colspan="<?php echo $coldisplay - (!getDolGlobalString('MAIN_VIEW_LINE_NUMBER') ? 0 : 1) ?>"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
|
||||
<?php
|
||||
$prefillDates = false;
|
||||
$date_start_prefill = 0;
|
||||
$date_end_prefill = 0;
|
||||
if (getDolGlobalString('MAIN_FILL_SERVICE_DATES_FROM_LAST_SERVICE_LINE') && !empty($object->lines) && $i > 0) {
|
||||
for ($j = $i - 1; $j >= 0; $j--) {
|
||||
$lastline = $object->lines[$j];
|
||||
|
|
|
|||
|
|
@ -46,10 +46,15 @@ if (empty($object) || !is_object($object)) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
'@phan-var-force CommonObject $this
|
||||
@phan-var-force CommonObject $object
|
||||
@phan-var-force 0|1 $forceall
|
||||
@phan-var-force int $num
|
||||
'
|
||||
@phan-var-force PropaleLigne|ContratLigne|CommonObjectLine|CommonInvoiceLine|CommonOrderLine|ExpeditionLigne|DeliveryLine|FactureFournisseurLigneRec|SupplierInvoiceLine|SupplierProposalLine $line
|
||||
@phan-var-force CommonObject $this
|
||||
@phan-var-force Propal|Contrat|Commande|Facture|Expedition|Delivery|FactureFournisseur|FactureFournisseur|SupplierProposal $object
|
||||
@phan-var-force 0|1 $forceall
|
||||
@phan-var-force int $num
|
||||
@phan-var-force ?Product $product_static
|
||||
@phan-var-force string $text
|
||||
@phan-var-force string $description
|
||||
';
|
||||
|
||||
global $mysoc;
|
||||
|
|
@ -464,9 +469,14 @@ if ($this->status == 0 && $tmppermtoedit && $action != 'selectlines') {
|
|||
if (isModEnabled('asset') && $object->element == 'invoice_supplier') {
|
||||
print '<td class="linecolasset center">';
|
||||
$coldisplay++;
|
||||
if (!empty($product_static->accountancy_code_buy) ||
|
||||
!empty($product_static->accountancy_code_buy_intra) ||
|
||||
!empty($product_static->accountancy_code_buy_export)
|
||||
if (
|
||||
$product_static !== null
|
||||
&&
|
||||
(
|
||||
!empty($product_static->accountancy_code_buy) ||
|
||||
!empty($product_static->accountancy_code_buy_intra) ||
|
||||
!empty($product_static->accountancy_code_buy_export)
|
||||
)
|
||||
) {
|
||||
$accountancy_category_asset = getDolGlobalString('ASSET_ACCOUNTANCY_CATEGORY');
|
||||
$filters = array();
|
||||
|
|
|
|||
|
|
@ -2314,20 +2314,11 @@ class ExpenseReport extends CommonObject
|
|||
$this->applyOffset();
|
||||
$this->checkRules();
|
||||
|
||||
$result = $this->line->update($user);
|
||||
$result = $this->line->update($user, $notrigger);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call triggers
|
||||
$result = $this->call_trigger('EXPENSE_REPORT_DET_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -373,7 +373,6 @@ class ExpenseReportLine extends CommonObjectLine
|
|||
if ($resql) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'expensereport_det');
|
||||
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call triggers
|
||||
$result = $this->call_trigger('EXPENSE_REPORT_DET_CREATE', $user);
|
||||
|
|
@ -383,7 +382,6 @@ class ExpenseReportLine extends CommonObjectLine
|
|||
// End call triggers
|
||||
}
|
||||
|
||||
|
||||
if (!$fromaddline) {
|
||||
$tmpparent = new ExpenseReport($this->db);
|
||||
$tmpparent->fetch($this->fk_expensereport);
|
||||
|
|
@ -457,9 +455,10 @@ class ExpenseReportLine extends CommonObjectLine
|
|||
* Update line
|
||||
*
|
||||
* @param User $user User
|
||||
* @param int $notrigger 1=No trigger
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function update(User $user)
|
||||
public function update(User $user, $notrigger = 0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
|
@ -530,6 +529,15 @@ class ExpenseReportLine extends CommonObjectLine
|
|||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call triggers
|
||||
$result = $this->call_trigger('EXPENSE_REPORT_DET_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
|
|
@ -540,6 +548,4 @@ class ExpenseReportLine extends CommonObjectLine
|
|||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
// ajouter ici comput_ ...
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.ligne.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
|
||||
|
|
@ -1997,276 +1998,3 @@ class FactureFournisseurRec extends CommonInvoice
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage supplier invoice lines of templates.
|
||||
* Saved into database table llx_facture_fourn_det_rec
|
||||
*/
|
||||
class FactureFournisseurLigneRec extends CommonInvoiceLine
|
||||
{
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
public $element = 'invoice_supplier_det_rec';
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
*/
|
||||
public $table_element = 'facture_fourn_det_rec';
|
||||
|
||||
public $fk_facture_fourn;
|
||||
public $fk_parent;
|
||||
public $fk_product;
|
||||
public $ref_supplier;
|
||||
public $label;
|
||||
/**
|
||||
* @deprecated Use desc
|
||||
*/
|
||||
public $description;
|
||||
public $pu_ht;
|
||||
public $pu_ttc;
|
||||
|
||||
/**
|
||||
* @var float Quantity
|
||||
*/
|
||||
public $qty;
|
||||
public $remise_percent;
|
||||
public $fk_remise_except;
|
||||
public $vat_src_code;
|
||||
public $tva_tx;
|
||||
public $localtax1_tx;
|
||||
public $localtax1_type;
|
||||
public $localtax2_tx;
|
||||
public $localtax2_type;
|
||||
|
||||
public $product_type;
|
||||
public $date_start;
|
||||
public $date_end;
|
||||
public $info_bits;
|
||||
|
||||
/**
|
||||
* @var int special code
|
||||
*/
|
||||
public $special_code;
|
||||
public $rang;
|
||||
|
||||
public $fk_user_author;
|
||||
public $fk_user_modif;
|
||||
|
||||
|
||||
/**
|
||||
* Delete supplier order template line in database
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete(User $user, $notrigger = 0)
|
||||
{
|
||||
$error = 0;
|
||||
$this->db->begin();
|
||||
|
||||
if (! $error) {
|
||||
if (! $notrigger) {
|
||||
// Call triggers
|
||||
$result = $this->call_trigger('LINESUPPLIERBILLREC_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
} // Do also here what you must do to rollback action if trigger fail
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
$result = $this->deleteExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element . ' WHERE rowid=' . (int) $this->id;
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
if ($res === false) {
|
||||
$error++;
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error) {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
} else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get line of template invoice
|
||||
*
|
||||
* @param int $rowid Id of invoice
|
||||
* @return int 1 if OK, < 0 if KO
|
||||
*/
|
||||
public function fetch($rowid)
|
||||
{
|
||||
$sql = 'SELECT l.rowid,';
|
||||
$sql .= ' l.fk_facture_fourn, l.fk_parent_line, l.fk_product,';
|
||||
$sql .= ' l.ref as ref_supplier, l.label, l.description as line_desc, l.pu_ht, l.pu_ttc, l.qty, l.remise_percent, l.fk_remise_except,';
|
||||
$sql .= ' l.vat_src_code, l.tva_tx, l.localtax1_tx, l.localtax1_type, l.localtax2_tx, l.localtax2_type,';
|
||||
$sql .= ' l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc,';
|
||||
$sql .= ' l.product_type, l.date_start, l.date_end,';
|
||||
$sql .= ' l.info_bits, l.special_code, l.rang, l.fk_unit, l.import_key,';
|
||||
$sql .= ' l.fk_user_author, l.fk_user_modif, l.fk_multicurrency,';
|
||||
$sql .= ' l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc,';
|
||||
$sql .= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det_rec as l';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
||||
$sql .= ' WHERE l.rowid = '. (int) $rowid;
|
||||
$sql .= ' ORDER BY l.rang';
|
||||
|
||||
dol_syslog('FactureRec::fetch', LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$this->id = $objp->rowid;
|
||||
$this->fk_facture_fourn = $objp->fk_facture_fourn;
|
||||
$this->fk_parent = $objp->fk_parent_line;
|
||||
$this->fk_product = $objp->fk_product;
|
||||
$this->ref_supplier = $objp->ref_supplier;
|
||||
$this->label = $objp->label;
|
||||
$this->description = $objp->line_desc;
|
||||
$this->desc = $objp->line_desc;
|
||||
$this->pu_ht = $objp->pu_ht;
|
||||
$this->pu_ttc = $objp->pu_ttc;
|
||||
$this->qty = $objp->qty;
|
||||
$this->remise_percent = $objp->remise_percent;
|
||||
$this->fk_remise_except = $objp->fk_remise_except;
|
||||
$this->vat_src_code = $objp->vat_src_code;
|
||||
$this->tva_tx = $objp->tva_tx;
|
||||
$this->localtax1_tx = $objp->localtax1_tx;
|
||||
$this->localtax1_type = $objp->localtax1_type;
|
||||
$this->localtax2_tx = $objp->localtax2_tx;
|
||||
$this->localtax2_type = $objp->localtax2_type;
|
||||
$this->total_ht = $objp->total_ht;
|
||||
$this->total_tva = $objp->total_tva;
|
||||
$this->total_localtax1 = $objp->total_localtax1;
|
||||
$this->total_localtax2 = $objp->total_localtax2;
|
||||
$this->total_ttc = $objp->total_ttc;
|
||||
$this->product_type = $objp->product_type;
|
||||
$this->date_start = $objp->date_start;
|
||||
$this->date_end = $objp->date_end;
|
||||
$this->info_bits = $objp->info_bits;
|
||||
$this->special_code = $objp->special_code;
|
||||
$this->rang = $objp->rang;
|
||||
$this->fk_unit = $objp->fk_unit;
|
||||
$this->import_key = $objp->import_key;
|
||||
$this->fk_user_author = $objp->fk_user_author;
|
||||
$this->fk_user_modif = $objp->fk_user_modif;
|
||||
$this->fk_multicurrency = $objp->fk_multicurrency;
|
||||
$this->multicurrency_code = $objp->multicurrency_code;
|
||||
$this->multicurrency_subprice = $objp->multicurrency_subprice;
|
||||
$this->multicurrency_total_ht = $objp->multicurrency_total_ht;
|
||||
$this->multicurrency_total_tva = $objp->multicurrency_total_tva;
|
||||
$this->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
|
||||
|
||||
$this->db->free($result);
|
||||
return 1;
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update a line to supplier invoice template .
|
||||
*
|
||||
* @param User $user User
|
||||
* @param int $notrigger No trigger
|
||||
* @return int Return integer <0 if KO, Id of line if OK
|
||||
*/
|
||||
public function update(User $user, $notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$error = 0;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture_fourn_det_rec SET';
|
||||
$sql .= ' fk_facture_fourn = ' . (int) $this->fk_facture_fourn;
|
||||
$sql .= ', fk_parent_line = ' . (int) $this->fk_parent;
|
||||
$sql .= ', fk_product = ' . (int) $this->fk_product;
|
||||
$sql .= ', ref = ' . (!empty($this->ref) ? "'" . $this->db->escape($this->ref) . "'" : 'NULL');
|
||||
$sql .= ", label = " . (!empty($this->label) ? "'" . $this->db->escape($this->label) . "'" : 'NULL');
|
||||
$sql .= ", description = '" . $this->db->escape($this->desc ? $this->desc : $this->description) . "'";
|
||||
$sql .= ', pu_ht = ' . price2num($this->pu_ht);
|
||||
$sql .= ', pu_ttc = ' . price2num($this->pu_ttc);
|
||||
$sql .= ', qty = ' . price2num($this->qty);
|
||||
$sql .= ", remise_percent = '" . price2num($this->remise_percent) . "'";
|
||||
$sql .= ', fk_remise_except = ' . (int) $this->fk_remise_except;
|
||||
$sql .= ", vat_src_code = '" . $this->db->escape($this->vat_src_code) . "'";
|
||||
$sql .= ', tva_tx = ' . price2num($this->tva_tx);
|
||||
$sql .= ', localtax1_tx = ' . price2num($this->localtax1_tx);
|
||||
$sql .= ", localtax1_type = '" . $this->db->escape($this->localtax1_type) . "'";
|
||||
$sql .= ', localtax2_tx = ' . price2num($this->localtax2_tx);
|
||||
$sql .= ", localtax2_type = '" . $this->db->escape($this->localtax2_type) . "'";
|
||||
if (empty($this->skip_update_total)) {
|
||||
$sql .= ', total_ht = ' . price2num($this->total_ht);
|
||||
$sql .= ', total_tva = ' . price2num($this->total_tva);
|
||||
$sql .= ', total_localtax1 = ' . price2num($this->total_localtax1);
|
||||
$sql .= ', total_localtax2 = ' . price2num($this->total_localtax2);
|
||||
$sql .= ', total_ttc = ' . price2num($this->total_ttc);
|
||||
}
|
||||
$sql .= ', product_type = ' . (int) $this->product_type;
|
||||
$sql .= ', date_start = ' . (int) $this->date_start;
|
||||
$sql .= ', date_end = ' . (int) $this->date_end;
|
||||
$sql .= ", info_bits = " . ((int) $this->info_bits);
|
||||
$sql .= ', special_code =' . (int) $this->special_code;
|
||||
$sql .= ', rang = ' . (int) $this->rang;
|
||||
$sql .= ', fk_unit = ' .($this->fk_unit ? "'".$this->db->escape($this->fk_unit)."'" : 'null');
|
||||
$sql .= ', fk_user_modif = ' . (int) $user->id;
|
||||
$sql .= ' WHERE rowid = ' . (int) $this->id;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
dol_syslog(get_class($this). '::updateline', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if (!$error) {
|
||||
$result = $this->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('LINESUPPLIERBILLREC_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
} else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
396
htdocs/fourn/class/fournisseur.facture-rec.ligne.class.php
Normal file
396
htdocs/fourn/class/fournisseur.facture-rec.ligne.class.php
Normal file
|
|
@ -0,0 +1,396 @@
|
|||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2017-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2023-2024 Nick Fragoulis
|
||||
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/fourn/facture/class/fournisseur.facture-rec.ligne.class.php
|
||||
* \ingroup invoice
|
||||
* \brief File for class to manage invoice template lines
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.ligne.class.php';
|
||||
|
||||
/**
|
||||
* Class to manage supplier invoice lines of templates.
|
||||
* Saved into database table llx_facture_fourn_det_rec
|
||||
*/
|
||||
class FactureFournisseurLigneRec extends CommonInvoiceLine
|
||||
{
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
public $element = 'invoice_supplier_det_rec';
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
*/
|
||||
public $table_element = 'facture_fourn_det_rec';
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $fk_facture_fourn;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $fk_parent;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $fk_product;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $ref_supplier;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $label;
|
||||
/**
|
||||
* @deprecated Use desc
|
||||
* @var string
|
||||
*/
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
public $pu_ht;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
public $pu_ttc;
|
||||
|
||||
/**
|
||||
* @var float Quantity
|
||||
*/
|
||||
public $qty;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
public $remise_percent;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $fk_remise_except;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $vat_src_code;
|
||||
|
||||
/**
|
||||
* @var string|float
|
||||
*/
|
||||
public $tva_tx;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
public $localtax1_tx;
|
||||
|
||||
/**
|
||||
* @var int<0, 6>
|
||||
*/
|
||||
public $localtax1_type;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
public $localtax2_tx;
|
||||
|
||||
/**
|
||||
* @var int<0, 6>
|
||||
*/
|
||||
public $localtax2_type;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $product_type;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $date_start;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $date_end;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $info_bits;
|
||||
|
||||
/**
|
||||
* @var int special code
|
||||
*/
|
||||
public $special_code;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $rang;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $fk_user_author;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $fk_user_modif;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $skip_update_total;
|
||||
|
||||
|
||||
/**
|
||||
* Delete supplier order template line in database
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete(User $user, $notrigger = 0)
|
||||
{
|
||||
$error = 0;
|
||||
$this->db->begin();
|
||||
|
||||
if (! $error) {
|
||||
if (! $notrigger) {
|
||||
// Call triggers
|
||||
$result = $this->call_trigger('LINESUPPLIERBILLREC_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
} // Do also here what you must do to rollback action if trigger fail
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
$result = $this->deleteExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element . ' WHERE rowid=' . (int) $this->id;
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
if ($res === false) {
|
||||
$error++;
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error) {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
} else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get line of template invoice
|
||||
*
|
||||
* @param int $rowid Id of invoice
|
||||
* @return int 1 if OK, < 0 if KO
|
||||
*/
|
||||
public function fetch($rowid)
|
||||
{
|
||||
$sql = 'SELECT l.rowid,';
|
||||
$sql .= ' l.fk_facture_fourn, l.fk_parent_line, l.fk_product,';
|
||||
$sql .= ' l.ref as ref_supplier, l.label, l.description as line_desc, l.pu_ht, l.pu_ttc, l.qty, l.remise_percent, l.fk_remise_except,';
|
||||
$sql .= ' l.vat_src_code, l.tva_tx, l.localtax1_tx, l.localtax1_type, l.localtax2_tx, l.localtax2_type,';
|
||||
$sql .= ' l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc,';
|
||||
$sql .= ' l.product_type, l.date_start, l.date_end,';
|
||||
$sql .= ' l.info_bits, l.special_code, l.rang, l.fk_unit, l.import_key,';
|
||||
$sql .= ' l.fk_user_author, l.fk_user_modif, l.fk_multicurrency,';
|
||||
$sql .= ' l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc,';
|
||||
$sql .= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det_rec as l';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
||||
$sql .= ' WHERE l.rowid = '. (int) $rowid;
|
||||
$sql .= ' ORDER BY l.rang';
|
||||
|
||||
dol_syslog('FactureRec::fetch', LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$this->id = $objp->rowid;
|
||||
$this->fk_facture_fourn = $objp->fk_facture_fourn;
|
||||
$this->fk_parent = $objp->fk_parent_line;
|
||||
$this->fk_product = $objp->fk_product;
|
||||
$this->ref_supplier = $objp->ref_supplier;
|
||||
$this->label = $objp->label;
|
||||
$this->description = $objp->line_desc;
|
||||
$this->desc = $objp->line_desc;
|
||||
$this->pu_ht = $objp->pu_ht;
|
||||
$this->pu_ttc = $objp->pu_ttc;
|
||||
$this->qty = $objp->qty;
|
||||
$this->remise_percent = $objp->remise_percent;
|
||||
$this->fk_remise_except = $objp->fk_remise_except;
|
||||
$this->vat_src_code = $objp->vat_src_code;
|
||||
$this->tva_tx = $objp->tva_tx;
|
||||
$this->localtax1_tx = $objp->localtax1_tx;
|
||||
$this->localtax1_type = $objp->localtax1_type;
|
||||
$this->localtax2_tx = $objp->localtax2_tx;
|
||||
$this->localtax2_type = $objp->localtax2_type;
|
||||
$this->total_ht = $objp->total_ht;
|
||||
$this->total_tva = $objp->total_tva;
|
||||
$this->total_localtax1 = $objp->total_localtax1;
|
||||
$this->total_localtax2 = $objp->total_localtax2;
|
||||
$this->total_ttc = $objp->total_ttc;
|
||||
$this->product_type = $objp->product_type;
|
||||
$this->date_start = $objp->date_start;
|
||||
$this->date_end = $objp->date_end;
|
||||
$this->info_bits = $objp->info_bits;
|
||||
$this->special_code = $objp->special_code;
|
||||
$this->rang = $objp->rang;
|
||||
$this->fk_unit = $objp->fk_unit;
|
||||
$this->import_key = $objp->import_key;
|
||||
$this->fk_user_author = $objp->fk_user_author;
|
||||
$this->fk_user_modif = $objp->fk_user_modif;
|
||||
$this->fk_multicurrency = $objp->fk_multicurrency;
|
||||
$this->multicurrency_code = $objp->multicurrency_code;
|
||||
$this->multicurrency_subprice = $objp->multicurrency_subprice;
|
||||
$this->multicurrency_total_ht = $objp->multicurrency_total_ht;
|
||||
$this->multicurrency_total_tva = $objp->multicurrency_total_tva;
|
||||
$this->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
|
||||
|
||||
$this->db->free($result);
|
||||
return 1;
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update a line to supplier invoice template .
|
||||
*
|
||||
* @param User $user User
|
||||
* @param int $notrigger No trigger
|
||||
* @return int Return integer <0 if KO, Id of line if OK
|
||||
*/
|
||||
public function update(User $user, $notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$error = 0;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture_fourn_det_rec SET';
|
||||
$sql .= ' fk_facture_fourn = ' . (int) $this->fk_facture_fourn;
|
||||
$sql .= ', fk_parent_line = ' . (int) $this->fk_parent;
|
||||
$sql .= ', fk_product = ' . (int) $this->fk_product;
|
||||
$sql .= ', ref = ' . (!empty($this->ref) ? "'" . $this->db->escape($this->ref) . "'" : 'NULL');
|
||||
$sql .= ", label = " . (!empty($this->label) ? "'" . $this->db->escape($this->label) . "'" : 'NULL');
|
||||
$sql .= ", description = '" . $this->db->escape($this->desc ? $this->desc : $this->description) . "'";
|
||||
$sql .= ', pu_ht = ' . price2num($this->pu_ht);
|
||||
$sql .= ', pu_ttc = ' . price2num($this->pu_ttc);
|
||||
$sql .= ', qty = ' . price2num($this->qty);
|
||||
$sql .= ", remise_percent = '" . price2num($this->remise_percent) . "'";
|
||||
$sql .= ', fk_remise_except = ' . (int) $this->fk_remise_except;
|
||||
$sql .= ", vat_src_code = '" . $this->db->escape($this->vat_src_code) . "'";
|
||||
$sql .= ', tva_tx = ' . price2num($this->tva_tx);
|
||||
$sql .= ', localtax1_tx = ' . price2num($this->localtax1_tx);
|
||||
$sql .= ", localtax1_type = '" . $this->db->escape($this->localtax1_type) . "'";
|
||||
$sql .= ', localtax2_tx = ' . price2num($this->localtax2_tx);
|
||||
$sql .= ", localtax2_type = '" . $this->db->escape($this->localtax2_type) . "'";
|
||||
if (empty($this->skip_update_total)) {
|
||||
$sql .= ', total_ht = ' . price2num($this->total_ht);
|
||||
$sql .= ', total_tva = ' . price2num($this->total_tva);
|
||||
$sql .= ', total_localtax1 = ' . price2num($this->total_localtax1);
|
||||
$sql .= ', total_localtax2 = ' . price2num($this->total_localtax2);
|
||||
$sql .= ', total_ttc = ' . price2num($this->total_ttc);
|
||||
}
|
||||
$sql .= ', product_type = ' . (int) $this->product_type;
|
||||
$sql .= ', date_start = ' . (int) $this->date_start;
|
||||
$sql .= ', date_end = ' . (int) $this->date_end;
|
||||
$sql .= ", info_bits = " . ((int) $this->info_bits);
|
||||
$sql .= ', special_code =' . (int) $this->special_code;
|
||||
$sql .= ', rang = ' . (int) $this->rang;
|
||||
$sql .= ', fk_unit = ' .($this->fk_unit ? "'".$this->db->escape($this->fk_unit)."'" : 'null');
|
||||
$sql .= ', fk_user_modif = ' . (int) $user->id;
|
||||
$sql .= ' WHERE rowid = ' . (int) $this->id;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
dol_syslog(get_class($this). '::updateline', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if (!$error) {
|
||||
$result = $this->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('LINESUPPLIERBILLREC_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
} else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -38,8 +38,8 @@
|
|||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.ligne.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
|
||||
if (isModEnabled('accounting')) {
|
||||
|
|
@ -3738,796 +3738,3 @@ class FactureFournisseur extends CommonInvoice
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage line invoices
|
||||
*/
|
||||
class SupplierInvoiceLine extends CommonObjectLine
|
||||
{
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
public $element = 'facture_fourn_det';
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
*/
|
||||
public $table_element = 'facture_fourn_det';
|
||||
|
||||
/**
|
||||
* @see CommonObjectLine
|
||||
*/
|
||||
public $parent_element = 'facture_fourn';
|
||||
|
||||
/**
|
||||
* @see CommonObjectLine
|
||||
*/
|
||||
public $fk_parent_attribute = 'fk_facture_fourn';
|
||||
|
||||
/**
|
||||
* @var static
|
||||
*/
|
||||
public $oldline;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @deprecated See $product_ref
|
||||
* @see $product_ref
|
||||
*/
|
||||
public $ref;
|
||||
|
||||
/**
|
||||
* Internal ref
|
||||
* @var string
|
||||
*/
|
||||
public $product_ref;
|
||||
|
||||
/**
|
||||
* Supplier reference of price when we added the line. May have been changed after line was added.
|
||||
* TODO Rename field ref to ref_supplier into table llx_facture_fourn_det and llx_commande_fournisseurdet and update fields into updateline
|
||||
* @var string
|
||||
*/
|
||||
public $ref_supplier;
|
||||
|
||||
/**
|
||||
* Product description
|
||||
* @var string
|
||||
*/
|
||||
public $product_desc;
|
||||
|
||||
/**
|
||||
* Unit price before taxes
|
||||
* @var float
|
||||
* @deprecated Use $subprice
|
||||
* @see $subprice
|
||||
*/
|
||||
public $pu_ht;
|
||||
|
||||
/**
|
||||
* Unit price excluded taxes
|
||||
* @var float
|
||||
*/
|
||||
public $subprice;
|
||||
|
||||
/**
|
||||
* Unit price included taxes
|
||||
* @var float
|
||||
*/
|
||||
public $pu_ttc;
|
||||
|
||||
|
||||
/**
|
||||
* Id of the corresponding supplier invoice
|
||||
* @var int
|
||||
*/
|
||||
public $fk_facture_fourn;
|
||||
|
||||
/**
|
||||
* This field may contains label of line (when invoice create from order)
|
||||
* @var string
|
||||
* @deprecated Use $product_label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* Description of the line
|
||||
* @var string
|
||||
* @deprecated Use $desc
|
||||
*/
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_start;
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_end;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $fk_code_ventilation;
|
||||
|
||||
/**
|
||||
* @var int<0,1>
|
||||
*/
|
||||
public $skip_update_total; // Skip update price total for special lines
|
||||
|
||||
/**
|
||||
* @var float Situation progress percentage
|
||||
*/
|
||||
public $situation_percent;
|
||||
|
||||
/**
|
||||
* @var int Previous situation line id reference
|
||||
*/
|
||||
public $fk_prev_id;
|
||||
|
||||
/**
|
||||
* VAT code
|
||||
* @var string
|
||||
*/
|
||||
public $vat_src_code;
|
||||
|
||||
/**
|
||||
* VAT %
|
||||
* @var float
|
||||
*/
|
||||
public $tva_tx;
|
||||
|
||||
/**
|
||||
* Local tax 1 %
|
||||
* @var float
|
||||
*/
|
||||
public $localtax1_tx;
|
||||
|
||||
/**
|
||||
* Local tax 2 %
|
||||
* @var float
|
||||
*/
|
||||
public $localtax2_tx;
|
||||
|
||||
/**
|
||||
* Quantity
|
||||
* @var float
|
||||
*/
|
||||
public $qty;
|
||||
|
||||
/**
|
||||
* Percent of discount
|
||||
* @var float|string
|
||||
*/
|
||||
public $remise_percent;
|
||||
|
||||
/**
|
||||
* Buying price value
|
||||
* @var float
|
||||
*/
|
||||
public $pa_ht;
|
||||
|
||||
/**
|
||||
* Total amount without taxes
|
||||
* @var float
|
||||
*/
|
||||
public $total_ht;
|
||||
|
||||
/**
|
||||
* Total amount with taxes
|
||||
* @var float
|
||||
*/
|
||||
public $total_ttc;
|
||||
|
||||
/**
|
||||
* Total amount of taxes
|
||||
* @var float
|
||||
*/
|
||||
public $total_tva;
|
||||
|
||||
/**
|
||||
* Total local tax 1 amount
|
||||
* @var float
|
||||
*/
|
||||
public $total_localtax1;
|
||||
|
||||
/**
|
||||
* Total local tax 2 amount
|
||||
* @var float
|
||||
*/
|
||||
public $total_localtax2;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_product;
|
||||
|
||||
/**
|
||||
* Type of the product. 0 for product 1 for service
|
||||
* @var int
|
||||
*/
|
||||
public $product_type;
|
||||
|
||||
/**
|
||||
* Label of the product
|
||||
* @var string
|
||||
*/
|
||||
public $product_label;
|
||||
|
||||
/**
|
||||
* List of cumulative options:
|
||||
* Bit 0: 0 si TVA normal - 1 si TVA NPR
|
||||
* Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except)
|
||||
* @var int
|
||||
*/
|
||||
public $info_bits;
|
||||
|
||||
/**
|
||||
* Link to line into llx_remise_except
|
||||
* @var int
|
||||
*/
|
||||
public $fk_remise_except;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_parent_line;
|
||||
|
||||
/**
|
||||
* @var int special code
|
||||
*/
|
||||
public $special_code;
|
||||
|
||||
/**
|
||||
* @var int rank of line
|
||||
*/
|
||||
public $rang;
|
||||
|
||||
/**
|
||||
* Total local tax 1 amount
|
||||
* @var float
|
||||
*/
|
||||
public $localtax1_type;
|
||||
|
||||
/**
|
||||
* Total local tax 2 amount
|
||||
* @var float
|
||||
*/
|
||||
public $localtax2_type;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a supplier invoice line
|
||||
*
|
||||
* @param int $rowid Line id
|
||||
* @return int Return integer <0 KO; 0 NOT FOUND; 1 OK
|
||||
*/
|
||||
public function fetch($rowid)
|
||||
{
|
||||
$sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description as line_desc, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx';
|
||||
$sql .= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2, f.fk_remise_except';
|
||||
$sql .= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_facture_fourn, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit';
|
||||
$sql .= ', p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc';
|
||||
$sql .= ', f.multicurrency_subprice, f.multicurrency_total_ht, f.multicurrency_total_tva, multicurrency_total_ttc';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid';
|
||||
$sql .= ' WHERE f.rowid = '.((int) $rowid);
|
||||
$sql .= ' ORDER BY f.rang, f.rowid';
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
if (!$query) {
|
||||
$this->errors[] = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!$this->db->num_rows($query)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$obj = $this->db->fetch_object($query);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->rowid = $obj->rowid;
|
||||
$this->fk_facture_fourn = $obj->fk_facture_fourn;
|
||||
$this->description = $obj->line_desc;
|
||||
$this->desc = $obj->line_desc;
|
||||
$this->date_start = $obj->date_start;
|
||||
$this->date_end = $obj->date_end;
|
||||
$this->product_ref = $obj->product_ref;
|
||||
$this->ref_supplier = $obj->ref_supplier;
|
||||
$this->product_desc = $obj->product_desc;
|
||||
|
||||
$this->subprice = $obj->pu_ht;
|
||||
$this->pu_ht = $this->subprice;
|
||||
$this->pu_ttc = $obj->pu_ttc;
|
||||
$this->tva_tx = $obj->tva_tx;
|
||||
$this->localtax1_tx = $obj->localtax1_tx;
|
||||
$this->localtax2_tx = $obj->localtax2_tx;
|
||||
$this->localtax1_type = $obj->localtax1_type;
|
||||
$this->localtax2_type = $obj->localtax2_type;
|
||||
|
||||
$this->qty = $obj->qty;
|
||||
$this->remise_percent = $obj->remise_percent;
|
||||
$this->fk_remise_except = $obj->fk_remise_except;
|
||||
//$this->tva = $obj->total_tva; // deprecated
|
||||
$this->total_ht = $obj->total_ht;
|
||||
$this->total_tva = $obj->total_tva;
|
||||
$this->total_localtax1 = $obj->total_localtax1;
|
||||
$this->total_localtax2 = $obj->total_localtax2;
|
||||
$this->total_ttc = $obj->total_ttc;
|
||||
$this->fk_product = $obj->fk_product;
|
||||
$this->product_type = $obj->product_type;
|
||||
$this->product_label = $obj->product_label;
|
||||
$this->label = $obj->product_label;
|
||||
$this->info_bits = $obj->info_bits;
|
||||
$this->fk_parent_line = $obj->fk_parent_line;
|
||||
$this->special_code = $obj->special_code;
|
||||
$this->rang = $obj->rang;
|
||||
$this->fk_unit = $obj->fk_unit;
|
||||
|
||||
$this->multicurrency_subprice = $obj->multicurrency_subprice;
|
||||
$this->multicurrency_total_ht = $obj->multicurrency_total_ht;
|
||||
$this->multicurrency_total_tva = $obj->multicurrency_total_tva;
|
||||
$this->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
|
||||
|
||||
$this->fetch_optionals();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a line
|
||||
*
|
||||
* @param int $notrigger 1=Does not execute triggers, 0=execute triggers
|
||||
* @return int 0 if KO, 1 if OK
|
||||
*/
|
||||
public function delete($notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
dol_syslog(get_class($this)."::deleteline rowid=".((int) $this->id), LOG_DEBUG);
|
||||
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (!$notrigger) {
|
||||
if ($this->call_trigger('LINEBILL_SUPPLIER_DELETE', $user) < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->deleteObjectLinked();
|
||||
|
||||
// Remove extrafields
|
||||
if (!$error) {
|
||||
$result = $this->deleteExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Supprime ligne
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det ';
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a supplier invoice line
|
||||
*
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function update($notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$pu = price2num($this->subprice);
|
||||
$qty = price2num($this->qty);
|
||||
|
||||
// Check parameters
|
||||
if (empty($this->qty)) {
|
||||
$this->qty = 0;
|
||||
}
|
||||
|
||||
if ($this->product_type < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->remise_percent)) {
|
||||
$this->remise_percent = 0;
|
||||
}
|
||||
if (empty($this->tva_tx)) {
|
||||
$this->tva_tx = 0;
|
||||
}
|
||||
if (empty($this->localtax1_tx)) {
|
||||
$this->localtax1_tx = 0;
|
||||
}
|
||||
if (empty($this->localtax2_tx)) {
|
||||
$this->localtax2_tx = 0;
|
||||
}
|
||||
|
||||
if (empty($this->pa_ht)) {
|
||||
$this->pa_ht = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_subprice)) {
|
||||
$this->multicurrency_subprice = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_ht)) {
|
||||
$this->multicurrency_total_ht = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_tva)) {
|
||||
$this->multicurrency_total_tva = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_ttc)) {
|
||||
$this->multicurrency_total_ttc = 0;
|
||||
}
|
||||
|
||||
$fk_product = (int) $this->fk_product;
|
||||
$fk_unit = (int) $this->fk_unit;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";
|
||||
$sql .= " description = '".$this->db->escape(empty($this->description) ? $this->desc : $this->description)."'";
|
||||
$sql .= ", ref = '".$this->db->escape($this->ref_supplier ? $this->ref_supplier : $this->ref)."'";
|
||||
$sql .= ", date_start = ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : "null");
|
||||
$sql .= ", date_end = ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : "null");
|
||||
$sql .= ", pu_ht = ".price2num($this->subprice);
|
||||
$sql .= ", pu_ttc = ".price2num($this->pu_ttc);
|
||||
$sql .= ", qty = ".price2num($this->qty);
|
||||
$sql .= ", remise_percent = ".price2num($this->remise_percent);
|
||||
if ($this->fk_remise_except > 0) {
|
||||
$sql .= ", fk_remise_except=".((int) $this->fk_remise_except);
|
||||
} else {
|
||||
$sql .= ", fk_remise_except=null";
|
||||
}
|
||||
$sql .= ", vat_src_code = '".$this->db->escape(empty($this->vat_src_code) ? '' : $this->vat_src_code)."'";
|
||||
$sql .= ", tva_tx = ".price2num($this->tva_tx);
|
||||
$sql .= ", localtax1_tx = ".price2num($this->localtax1_tx);
|
||||
$sql .= ", localtax2_tx = ".price2num($this->localtax2_tx);
|
||||
$sql .= ", localtax1_type = '".$this->db->escape($this->localtax1_type)."'";
|
||||
$sql .= ", localtax2_type = '".$this->db->escape($this->localtax2_type)."'";
|
||||
$sql .= ", total_ht = ".price2num($this->total_ht);
|
||||
$sql .= ", tva= ".price2num($this->total_tva);
|
||||
$sql .= ", total_localtax1= ".price2num($this->total_localtax1);
|
||||
$sql .= ", total_localtax2= ".price2num($this->total_localtax2);
|
||||
$sql .= ", total_ttc = ".price2num($this->total_ttc);
|
||||
$sql .= ", fk_product = ".($fk_product > 0 ? (int) $fk_product : 'null');
|
||||
$sql .= ", product_type = ".((int) $this->product_type);
|
||||
$sql .= ", info_bits = ".((int) $this->info_bits);
|
||||
$sql .= ", fk_unit = ".($fk_unit > 0 ? (int) $fk_unit : 'null');
|
||||
|
||||
if (!empty($this->rang)) {
|
||||
$sql .= ", rang=".((int) $this->rang);
|
||||
}
|
||||
|
||||
// Multicurrency
|
||||
$sql .= " , multicurrency_subprice=".price2num($this->multicurrency_subprice);
|
||||
$sql .= " , multicurrency_total_ht=".price2num($this->multicurrency_total_ht);
|
||||
$sql .= " , multicurrency_total_tva=".price2num($this->multicurrency_total_tva);
|
||||
$sql .= " , multicurrency_total_ttc=".price2num($this->multicurrency_total_ttc);
|
||||
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if (!$resql) {
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->rowid = $this->id;
|
||||
$error = 0;
|
||||
|
||||
if (!$error) {
|
||||
$result = $this->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
global $langs, $user;
|
||||
|
||||
// Call trigger
|
||||
if ($this->call_trigger('LINEBILL_SUPPLIER_MODIFY', $user) < 0) {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert line into database
|
||||
*
|
||||
* @param int $notrigger 1 no triggers
|
||||
* @param int $noerrorifdiscountalreadylinked 1=Do not make error if lines is linked to a discount and discount already linked to another
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function insert($notrigger = 0, $noerrorifdiscountalreadylinked = 0)
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
$error = 0;
|
||||
|
||||
dol_syslog(get_class($this)."::insert rang=".$this->rang, LOG_DEBUG);
|
||||
|
||||
// Clean parameters
|
||||
$this->desc = trim($this->desc);
|
||||
if (empty($this->tva_tx)) {
|
||||
$this->tva_tx = 0;
|
||||
}
|
||||
if (empty($this->localtax1_tx)) {
|
||||
$this->localtax1_tx = 0;
|
||||
}
|
||||
if (empty($this->localtax2_tx)) {
|
||||
$this->localtax2_tx = 0;
|
||||
}
|
||||
if (empty($this->localtax1_type)) {
|
||||
$this->localtax1_type = 0.0;
|
||||
}
|
||||
if (empty($this->localtax2_type)) {
|
||||
$this->localtax2_type = 0.0;
|
||||
}
|
||||
if (empty($this->total_tva)) {
|
||||
$this->total_tva = 0;
|
||||
}
|
||||
if (empty($this->total_localtax1)) {
|
||||
$this->total_localtax1 = 0;
|
||||
}
|
||||
if (empty($this->total_localtax2)) {
|
||||
$this->total_localtax2 = 0;
|
||||
}
|
||||
if (empty($this->rang)) {
|
||||
$this->rang = 0;
|
||||
}
|
||||
if (empty($this->remise_percent)) {
|
||||
$this->remise_percent = 0;
|
||||
}
|
||||
if (empty($this->info_bits)) {
|
||||
$this->info_bits = 0;
|
||||
}
|
||||
if (empty($this->subprice)) {
|
||||
$this->subprice = 0;
|
||||
}
|
||||
if (empty($this->special_code)) {
|
||||
$this->special_code = 0;
|
||||
}
|
||||
if (empty($this->fk_parent_line)) {
|
||||
$this->fk_parent_line = 0;
|
||||
}
|
||||
if (!isset($this->situation_percent) || $this->situation_percent > 100 || (string) $this->situation_percent == '') {
|
||||
$this->situation_percent = 100;
|
||||
}
|
||||
|
||||
if (empty($this->pa_ht)) {
|
||||
$this->pa_ht = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_subprice)) {
|
||||
$this->multicurrency_subprice = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_ht)) {
|
||||
$this->multicurrency_total_ht = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_tva)) {
|
||||
$this->multicurrency_total_tva = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_ttc)) {
|
||||
$this->multicurrency_total_ttc = 0;
|
||||
}
|
||||
|
||||
|
||||
// Check parameters
|
||||
if ($this->product_type < 0) {
|
||||
$this->error = 'ErrorProductTypeMustBe0orMore';
|
||||
return -1;
|
||||
}
|
||||
if (!empty($this->fk_product) && $this->fk_product > 0) {
|
||||
// Check product exists
|
||||
$result = Product::isExistingObject('product', $this->fk_product);
|
||||
if ($result <= 0) {
|
||||
$this->error = 'ErrorProductIdDoesNotExists';
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Insertion dans base de la ligne
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= ' (fk_facture_fourn, fk_parent_line, label, description, ref, qty,';
|
||||
$sql .= ' vat_src_code, tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,';
|
||||
$sql .= ' fk_product, product_type, remise_percent, fk_remise_except, pu_ht, pu_ttc,';
|
||||
$sql .= ' date_start, date_end, fk_code_ventilation, rang, special_code,';
|
||||
$sql .= ' info_bits, total_ht, tva, total_ttc, total_localtax1, total_localtax2, fk_unit';
|
||||
$sql .= ', fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc';
|
||||
$sql .= ')';
|
||||
$sql .= " VALUES (".$this->fk_facture_fourn.",";
|
||||
$sql .= " ".($this->fk_parent_line > 0 ? "'".$this->db->escape($this->fk_parent_line)."'" : "null").",";
|
||||
$product_label
|
||||
= !empty($this->product_label)
|
||||
? $this->product_label :
|
||||
(!empty($this->label) ? $this->label : null);
|
||||
$sql .= " ".(!empty($product_label) ? "'".$this->db->escape($product_label)."'" : "null").",";
|
||||
$sql .= " '".$this->db->escape($this->desc ? $this->desc : $this->description)."',";
|
||||
$sql .= " '".$this->db->escape($this->ref_supplier)."',";
|
||||
$sql .= " ".price2num($this->qty).",";
|
||||
|
||||
$sql .= " ".(empty($this->vat_src_code) ? "''" : "'".$this->db->escape($this->vat_src_code)."'").",";
|
||||
$sql .= " ".price2num($this->tva_tx).",";
|
||||
$sql .= " ".price2num($this->localtax1_tx).",";
|
||||
$sql .= " ".price2num($this->localtax2_tx).",";
|
||||
$sql .= " '".$this->db->escape($this->localtax1_type)."',";
|
||||
$sql .= " '".$this->db->escape($this->localtax2_type)."',";
|
||||
$sql .= ' '.((!empty($this->fk_product) && $this->fk_product > 0) ? $this->fk_product : "null").',';
|
||||
$sql .= " ".((int) $this->product_type).",";
|
||||
$sql .= " ".price2num($this->remise_percent).",";
|
||||
$sql .= ' '.(!empty($this->fk_remise_except) ? ((int) $this->fk_remise_except) : "null").',';
|
||||
$sql .= " ".price2num($this->subprice).",";
|
||||
$sql .= " ".(!empty($this->qty) ? price2num($this->total_ttc / $this->qty) : price2num($this->total_ttc)).",";
|
||||
$sql .= " ".(!empty($this->date_start) ? "'".$this->db->idate($this->date_start)."'" : "null").",";
|
||||
$sql .= " ".(!empty($this->date_end) ? "'".$this->db->idate($this->date_end)."'" : "null").",";
|
||||
$sql .= ' '.(!empty($this->fk_code_ventilation) ? $this->fk_code_ventilation : 0).',';
|
||||
$sql .= ' '.((int) $this->rang).',';
|
||||
$sql .= ' '.((int) $this->special_code).',';
|
||||
$sql .= " ".((int) $this->info_bits).",";
|
||||
$sql .= " ".price2num($this->total_ht).",";
|
||||
$sql .= " ".price2num($this->total_tva).",";
|
||||
$sql .= " ".price2num($this->total_ttc).",";
|
||||
$sql .= " ".price2num($this->total_localtax1).",";
|
||||
$sql .= " ".price2num($this->total_localtax2);
|
||||
$sql .= ", ".(!$this->fk_unit ? 'NULL' : $this->fk_unit);
|
||||
$sql .= ", ".(int) $this->fk_multicurrency;
|
||||
$sql .= ", '".$this->db->escape($this->multicurrency_code)."'";
|
||||
$sql .= ", ".price2num($this->multicurrency_subprice);
|
||||
$sql .= ", ".price2num($this->multicurrency_total_ht);
|
||||
$sql .= ", ".price2num($this->multicurrency_total_tva);
|
||||
$sql .= ", ".price2num($this->multicurrency_total_ttc);
|
||||
$sql .= ')';
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
||||
$this->rowid = $this->id; // backward compatibility
|
||||
|
||||
if (!$error) {
|
||||
$result = $this->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// Si fk_remise_except defini, on lie la remise a la facture
|
||||
// ce qui la flague comme "consommee".
|
||||
if ($this->fk_remise_except) {
|
||||
$discount = new DiscountAbsolute($this->db);
|
||||
$result = $discount->fetch($this->fk_remise_except);
|
||||
if ($result >= 0) {
|
||||
// Check if discount was found
|
||||
if ($result > 0) {
|
||||
// Check if discount not already affected to another invoice
|
||||
if ($discount->fk_facture_line > 0) {
|
||||
if (empty($noerrorifdiscountalreadylinked)) {
|
||||
$this->error = $langs->trans("ErrorDiscountAlreadyUsed", $discount->id);
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
} else {
|
||||
$result = $discount->link_to_invoice($this->id, 0);
|
||||
if ($result < 0) {
|
||||
$this->error = $discount->error;
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = $langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded");
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
} else {
|
||||
$this->error = $discount->error;
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('LINEBILL_SUPPLIER_CREATE', $user);
|
||||
if ($result < 0) {
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Mise a jour de l'objet ligne de commande en base
|
||||
*
|
||||
* @return int Return integer <0 si ko, >0 si ok
|
||||
*/
|
||||
public function update_total()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
|
||||
// Mise a jour ligne en base
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";
|
||||
$sql .= " total_ht = ".price2num($this->total_ht);
|
||||
$sql .= ", tva= ".price2num($this->total_tva);
|
||||
$sql .= ", total_localtax1 = ".price2num($this->total_localtax1);
|
||||
$sql .= ", total_localtax2 = ".price2num($this->total_localtax2);
|
||||
$sql .= ", total_ttc = ".price2num($this->total_ttc);
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog("FactureFournisseurLigne.class.php::update_total", LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
839
htdocs/fourn/class/fournisseur.facture.ligne.class.php
Normal file
839
htdocs/fourn/class/fournisseur.facture.ligne.class.php
Normal file
|
|
@ -0,0 +1,839 @@
|
|||
<?php
|
||||
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005 Marc Barilley <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2019 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||
* Copyright (C) 2015-2022 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2016-2023 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2023 Nick Fragoulis
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/fourn/class/fournisseur.facture.ligne.class.php
|
||||
* \ingroup fournisseur,facture
|
||||
* \brief File of class to manage supplier invoice lines
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
|
||||
if (isModEnabled('accounting')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to manage line invoices
|
||||
*/
|
||||
class SupplierInvoiceLine extends CommonObjectLine
|
||||
{
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
*/
|
||||
public $element = 'facture_fourn_det';
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored
|
||||
*/
|
||||
public $table_element = 'facture_fourn_det';
|
||||
|
||||
/**
|
||||
* @see CommonObjectLine
|
||||
*/
|
||||
public $parent_element = 'facture_fourn';
|
||||
|
||||
/**
|
||||
* @see CommonObjectLine
|
||||
*/
|
||||
public $fk_parent_attribute = 'fk_facture_fourn';
|
||||
|
||||
/**
|
||||
* @var static
|
||||
*/
|
||||
public $oldline;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @deprecated See $product_ref
|
||||
* @see $product_ref
|
||||
*/
|
||||
public $ref;
|
||||
|
||||
/**
|
||||
* Internal ref
|
||||
* @var string
|
||||
*/
|
||||
public $product_ref;
|
||||
|
||||
/**
|
||||
* Supplier reference of price when we added the line. May have been changed after line was added.
|
||||
* TODO Rename field ref to ref_supplier into table llx_facture_fourn_det and llx_commande_fournisseurdet and update fields into updateline
|
||||
* @var string
|
||||
*/
|
||||
public $ref_supplier;
|
||||
|
||||
/**
|
||||
* Product description
|
||||
* @var string
|
||||
*/
|
||||
public $product_desc;
|
||||
|
||||
/**
|
||||
* Unit price before taxes
|
||||
* @var float
|
||||
* @deprecated Use $subprice
|
||||
* @see $subprice
|
||||
*/
|
||||
public $pu_ht;
|
||||
|
||||
/**
|
||||
* Unit price excluded taxes
|
||||
* @var float
|
||||
*/
|
||||
public $subprice;
|
||||
|
||||
/**
|
||||
* Unit price included taxes
|
||||
* @var float
|
||||
*/
|
||||
public $pu_ttc;
|
||||
|
||||
|
||||
/**
|
||||
* Id of the corresponding supplier invoice
|
||||
* @var int
|
||||
*/
|
||||
public $fk_facture_fourn;
|
||||
|
||||
/**
|
||||
* This field may contains label of line (when invoice create from order)
|
||||
* @var string
|
||||
* @deprecated Use $product_label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* Description of the line
|
||||
* @var string
|
||||
* @deprecated Use $desc
|
||||
*/
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_start;
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_end;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $fk_code_ventilation;
|
||||
|
||||
/**
|
||||
* @var int<0,1>
|
||||
*/
|
||||
public $skip_update_total; // Skip update price total for special lines
|
||||
|
||||
/**
|
||||
* @var float Situation progress percentage
|
||||
*/
|
||||
public $situation_percent;
|
||||
|
||||
/**
|
||||
* @var int Previous situation line id reference
|
||||
*/
|
||||
public $fk_prev_id;
|
||||
|
||||
/**
|
||||
* VAT code
|
||||
* @var string
|
||||
*/
|
||||
public $vat_src_code;
|
||||
|
||||
/**
|
||||
* VAT %
|
||||
* @var float
|
||||
*/
|
||||
public $tva_tx;
|
||||
|
||||
/**
|
||||
* Local tax 1 %
|
||||
* @var float
|
||||
*/
|
||||
public $localtax1_tx;
|
||||
|
||||
/**
|
||||
* Local tax 2 %
|
||||
* @var float
|
||||
*/
|
||||
public $localtax2_tx;
|
||||
|
||||
/**
|
||||
* Quantity
|
||||
* @var float
|
||||
*/
|
||||
public $qty;
|
||||
|
||||
/**
|
||||
* Percent of discount
|
||||
* @var float|string
|
||||
*/
|
||||
public $remise_percent;
|
||||
|
||||
/**
|
||||
* Buying price value
|
||||
* @var float
|
||||
*/
|
||||
public $pa_ht;
|
||||
|
||||
/**
|
||||
* Total amount without taxes
|
||||
* @var float
|
||||
*/
|
||||
public $total_ht;
|
||||
|
||||
/**
|
||||
* Total amount with taxes
|
||||
* @var float
|
||||
*/
|
||||
public $total_ttc;
|
||||
|
||||
/**
|
||||
* Total amount of taxes
|
||||
* @var float
|
||||
*/
|
||||
public $total_tva;
|
||||
|
||||
/**
|
||||
* Total local tax 1 amount
|
||||
* @var float
|
||||
*/
|
||||
public $total_localtax1;
|
||||
|
||||
/**
|
||||
* Total local tax 2 amount
|
||||
* @var float
|
||||
*/
|
||||
public $total_localtax2;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_product;
|
||||
|
||||
/**
|
||||
* Type of the product. 0 for product 1 for service
|
||||
* @var int
|
||||
*/
|
||||
public $product_type;
|
||||
|
||||
/**
|
||||
* Label of the product
|
||||
* @var string
|
||||
*/
|
||||
public $product_label;
|
||||
|
||||
/**
|
||||
* List of cumulative options:
|
||||
* Bit 0: 0 si TVA normal - 1 si TVA NPR
|
||||
* Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except)
|
||||
* @var int
|
||||
*/
|
||||
public $info_bits;
|
||||
|
||||
/**
|
||||
* Link to line into llx_remise_except
|
||||
* @var int
|
||||
*/
|
||||
public $fk_remise_except;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_parent_line;
|
||||
|
||||
/**
|
||||
* @var int special code
|
||||
*/
|
||||
public $special_code;
|
||||
|
||||
/**
|
||||
* @var int rank of line
|
||||
*/
|
||||
public $rang;
|
||||
|
||||
/**
|
||||
* Total local tax 1 amount
|
||||
* @var float
|
||||
*/
|
||||
public $localtax1_type;
|
||||
|
||||
/**
|
||||
* Total local tax 2 amount
|
||||
* @var float
|
||||
*/
|
||||
public $localtax2_type;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a supplier invoice line
|
||||
*
|
||||
* @param int $rowid Line id
|
||||
* @return int Return integer <0 KO; 0 NOT FOUND; 1 OK
|
||||
*/
|
||||
public function fetch($rowid)
|
||||
{
|
||||
$sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description as line_desc, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.tva_tx';
|
||||
$sql .= ', f.localtax1_type, f.localtax2_type, f.localtax1_tx, f.localtax2_tx, f.total_localtax1, f.total_localtax2, f.fk_remise_except';
|
||||
$sql .= ', f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_facture_fourn, f.fk_product, f.product_type, f.info_bits, f.rang, f.special_code, f.fk_parent_line, f.fk_unit';
|
||||
$sql .= ', p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc';
|
||||
$sql .= ', f.multicurrency_subprice, f.multicurrency_total_ht, f.multicurrency_total_tva, multicurrency_total_ttc';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid';
|
||||
$sql .= ' WHERE f.rowid = '.((int) $rowid);
|
||||
$sql .= ' ORDER BY f.rang, f.rowid';
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
if (!$query) {
|
||||
$this->errors[] = $this->db->error();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!$this->db->num_rows($query)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$obj = $this->db->fetch_object($query);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->rowid = $obj->rowid;
|
||||
$this->fk_facture_fourn = $obj->fk_facture_fourn;
|
||||
$this->description = $obj->line_desc;
|
||||
$this->desc = $obj->line_desc;
|
||||
$this->date_start = $obj->date_start;
|
||||
$this->date_end = $obj->date_end;
|
||||
$this->product_ref = $obj->product_ref;
|
||||
$this->ref_supplier = $obj->ref_supplier;
|
||||
$this->product_desc = $obj->product_desc;
|
||||
|
||||
$this->subprice = $obj->pu_ht;
|
||||
$this->pu_ht = $this->subprice;
|
||||
$this->pu_ttc = $obj->pu_ttc;
|
||||
$this->tva_tx = $obj->tva_tx;
|
||||
$this->localtax1_tx = $obj->localtax1_tx;
|
||||
$this->localtax2_tx = $obj->localtax2_tx;
|
||||
$this->localtax1_type = $obj->localtax1_type;
|
||||
$this->localtax2_type = $obj->localtax2_type;
|
||||
|
||||
$this->qty = $obj->qty;
|
||||
$this->remise_percent = $obj->remise_percent;
|
||||
$this->fk_remise_except = $obj->fk_remise_except;
|
||||
//$this->tva = $obj->total_tva; // deprecated
|
||||
$this->total_ht = $obj->total_ht;
|
||||
$this->total_tva = $obj->total_tva;
|
||||
$this->total_localtax1 = $obj->total_localtax1;
|
||||
$this->total_localtax2 = $obj->total_localtax2;
|
||||
$this->total_ttc = $obj->total_ttc;
|
||||
$this->fk_product = $obj->fk_product;
|
||||
$this->product_type = $obj->product_type;
|
||||
$this->product_label = $obj->product_label;
|
||||
$this->label = $obj->product_label;
|
||||
$this->info_bits = $obj->info_bits;
|
||||
$this->fk_parent_line = $obj->fk_parent_line;
|
||||
$this->special_code = $obj->special_code;
|
||||
$this->rang = $obj->rang;
|
||||
$this->fk_unit = $obj->fk_unit;
|
||||
|
||||
$this->multicurrency_subprice = $obj->multicurrency_subprice;
|
||||
$this->multicurrency_total_ht = $obj->multicurrency_total_ht;
|
||||
$this->multicurrency_total_tva = $obj->multicurrency_total_tva;
|
||||
$this->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
|
||||
|
||||
$this->fetch_optionals();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a line
|
||||
*
|
||||
* @param int $notrigger 1=Does not execute triggers, 0=execute triggers
|
||||
* @return int 0 if KO, 1 if OK
|
||||
*/
|
||||
public function delete($notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
dol_syslog(get_class($this)."::deleteline rowid=".((int) $this->id), LOG_DEBUG);
|
||||
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (!$notrigger) {
|
||||
if ($this->call_trigger('LINEBILL_SUPPLIER_DELETE', $user) < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->deleteObjectLinked();
|
||||
|
||||
// Remove extrafields
|
||||
if (!$error) {
|
||||
$result = $this->deleteExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Supprime ligne
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det ';
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a supplier invoice line
|
||||
*
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function update($notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$pu = price2num($this->subprice);
|
||||
$qty = price2num($this->qty);
|
||||
|
||||
// Check parameters
|
||||
if (empty($this->qty)) {
|
||||
$this->qty = 0;
|
||||
}
|
||||
|
||||
if ($this->product_type < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->remise_percent)) {
|
||||
$this->remise_percent = 0;
|
||||
}
|
||||
if (empty($this->tva_tx)) {
|
||||
$this->tva_tx = 0;
|
||||
}
|
||||
if (empty($this->localtax1_tx)) {
|
||||
$this->localtax1_tx = 0;
|
||||
}
|
||||
if (empty($this->localtax2_tx)) {
|
||||
$this->localtax2_tx = 0;
|
||||
}
|
||||
|
||||
if (empty($this->pa_ht)) {
|
||||
$this->pa_ht = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_subprice)) {
|
||||
$this->multicurrency_subprice = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_ht)) {
|
||||
$this->multicurrency_total_ht = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_tva)) {
|
||||
$this->multicurrency_total_tva = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_ttc)) {
|
||||
$this->multicurrency_total_ttc = 0;
|
||||
}
|
||||
|
||||
$fk_product = (int) $this->fk_product;
|
||||
$fk_unit = (int) $this->fk_unit;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";
|
||||
$sql .= " description = '".$this->db->escape(empty($this->description) ? $this->desc : $this->description)."'";
|
||||
$sql .= ", ref = '".$this->db->escape($this->ref_supplier ? $this->ref_supplier : $this->ref)."'";
|
||||
$sql .= ", date_start = ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : "null");
|
||||
$sql .= ", date_end = ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : "null");
|
||||
$sql .= ", pu_ht = ".price2num($this->subprice);
|
||||
$sql .= ", pu_ttc = ".price2num($this->pu_ttc);
|
||||
$sql .= ", qty = ".price2num($this->qty);
|
||||
$sql .= ", remise_percent = ".price2num($this->remise_percent);
|
||||
if ($this->fk_remise_except > 0) {
|
||||
$sql .= ", fk_remise_except=".((int) $this->fk_remise_except);
|
||||
} else {
|
||||
$sql .= ", fk_remise_except=null";
|
||||
}
|
||||
$sql .= ", vat_src_code = '".$this->db->escape(empty($this->vat_src_code) ? '' : $this->vat_src_code)."'";
|
||||
$sql .= ", tva_tx = ".price2num($this->tva_tx);
|
||||
$sql .= ", localtax1_tx = ".price2num($this->localtax1_tx);
|
||||
$sql .= ", localtax2_tx = ".price2num($this->localtax2_tx);
|
||||
$sql .= ", localtax1_type = '".$this->db->escape($this->localtax1_type)."'";
|
||||
$sql .= ", localtax2_type = '".$this->db->escape($this->localtax2_type)."'";
|
||||
$sql .= ", total_ht = ".price2num($this->total_ht);
|
||||
$sql .= ", tva= ".price2num($this->total_tva);
|
||||
$sql .= ", total_localtax1= ".price2num($this->total_localtax1);
|
||||
$sql .= ", total_localtax2= ".price2num($this->total_localtax2);
|
||||
$sql .= ", total_ttc = ".price2num($this->total_ttc);
|
||||
$sql .= ", fk_product = ".($fk_product > 0 ? (int) $fk_product : 'null');
|
||||
$sql .= ", product_type = ".((int) $this->product_type);
|
||||
$sql .= ", info_bits = ".((int) $this->info_bits);
|
||||
$sql .= ", fk_unit = ".($fk_unit > 0 ? (int) $fk_unit : 'null');
|
||||
|
||||
if (!empty($this->rang)) {
|
||||
$sql .= ", rang=".((int) $this->rang);
|
||||
}
|
||||
|
||||
// Multicurrency
|
||||
$sql .= " , multicurrency_subprice=".price2num($this->multicurrency_subprice);
|
||||
$sql .= " , multicurrency_total_ht=".price2num($this->multicurrency_total_ht);
|
||||
$sql .= " , multicurrency_total_tva=".price2num($this->multicurrency_total_tva);
|
||||
$sql .= " , multicurrency_total_ttc=".price2num($this->multicurrency_total_ttc);
|
||||
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if (!$resql) {
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->rowid = $this->id;
|
||||
$error = 0;
|
||||
|
||||
if (!$error) {
|
||||
$result = $this->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
global $langs, $user;
|
||||
|
||||
// Call trigger
|
||||
if ($this->call_trigger('LINEBILL_SUPPLIER_MODIFY', $user) < 0) {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert line into database
|
||||
*
|
||||
* @param int $notrigger 1 no triggers
|
||||
* @param int $noerrorifdiscountalreadylinked 1=Do not make error if lines is linked to a discount and discount already linked to another
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function insert($notrigger = 0, $noerrorifdiscountalreadylinked = 0)
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
$error = 0;
|
||||
|
||||
dol_syslog(get_class($this)."::insert rang=".$this->rang, LOG_DEBUG);
|
||||
|
||||
// Clean parameters
|
||||
$this->desc = trim($this->desc);
|
||||
if (empty($this->tva_tx)) {
|
||||
$this->tva_tx = 0;
|
||||
}
|
||||
if (empty($this->localtax1_tx)) {
|
||||
$this->localtax1_tx = 0;
|
||||
}
|
||||
if (empty($this->localtax2_tx)) {
|
||||
$this->localtax2_tx = 0;
|
||||
}
|
||||
if (empty($this->localtax1_type)) {
|
||||
$this->localtax1_type = 0.0;
|
||||
}
|
||||
if (empty($this->localtax2_type)) {
|
||||
$this->localtax2_type = 0.0;
|
||||
}
|
||||
if (empty($this->total_tva)) {
|
||||
$this->total_tva = 0;
|
||||
}
|
||||
if (empty($this->total_localtax1)) {
|
||||
$this->total_localtax1 = 0;
|
||||
}
|
||||
if (empty($this->total_localtax2)) {
|
||||
$this->total_localtax2 = 0;
|
||||
}
|
||||
if (empty($this->rang)) {
|
||||
$this->rang = 0;
|
||||
}
|
||||
if (empty($this->remise_percent)) {
|
||||
$this->remise_percent = 0;
|
||||
}
|
||||
if (empty($this->info_bits)) {
|
||||
$this->info_bits = 0;
|
||||
}
|
||||
if (empty($this->subprice)) {
|
||||
$this->subprice = 0;
|
||||
}
|
||||
if (empty($this->special_code)) {
|
||||
$this->special_code = 0;
|
||||
}
|
||||
if (empty($this->fk_parent_line)) {
|
||||
$this->fk_parent_line = 0;
|
||||
}
|
||||
if (!isset($this->situation_percent) || $this->situation_percent > 100 || (string) $this->situation_percent == '') {
|
||||
$this->situation_percent = 100;
|
||||
}
|
||||
|
||||
if (empty($this->pa_ht)) {
|
||||
$this->pa_ht = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_subprice)) {
|
||||
$this->multicurrency_subprice = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_ht)) {
|
||||
$this->multicurrency_total_ht = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_tva)) {
|
||||
$this->multicurrency_total_tva = 0;
|
||||
}
|
||||
if (empty($this->multicurrency_total_ttc)) {
|
||||
$this->multicurrency_total_ttc = 0;
|
||||
}
|
||||
|
||||
|
||||
// Check parameters
|
||||
if ($this->product_type < 0) {
|
||||
$this->error = 'ErrorProductTypeMustBe0orMore';
|
||||
return -1;
|
||||
}
|
||||
if (!empty($this->fk_product) && $this->fk_product > 0) {
|
||||
// Check product exists
|
||||
$result = Product::isExistingObject('product', $this->fk_product);
|
||||
if ($result <= 0) {
|
||||
$this->error = 'ErrorProductIdDoesNotExists';
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Insertion dans base de la ligne
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= ' (fk_facture_fourn, fk_parent_line, label, description, ref, qty,';
|
||||
$sql .= ' vat_src_code, tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,';
|
||||
$sql .= ' fk_product, product_type, remise_percent, fk_remise_except, pu_ht, pu_ttc,';
|
||||
$sql .= ' date_start, date_end, fk_code_ventilation, rang, special_code,';
|
||||
$sql .= ' info_bits, total_ht, tva, total_ttc, total_localtax1, total_localtax2, fk_unit';
|
||||
$sql .= ', fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc';
|
||||
$sql .= ')';
|
||||
$sql .= " VALUES (".$this->fk_facture_fourn.",";
|
||||
$sql .= " ".($this->fk_parent_line > 0 ? "'".$this->db->escape($this->fk_parent_line)."'" : "null").",";
|
||||
$product_label
|
||||
= !empty($this->product_label)
|
||||
? $this->product_label :
|
||||
(!empty($this->label) ? $this->label : null);
|
||||
$sql .= " ".(!empty($product_label) ? "'".$this->db->escape($product_label)."'" : "null").",";
|
||||
$sql .= " '".$this->db->escape($this->desc ? $this->desc : $this->description)."',";
|
||||
$sql .= " '".$this->db->escape($this->ref_supplier)."',";
|
||||
$sql .= " ".price2num($this->qty).",";
|
||||
|
||||
$sql .= " ".(empty($this->vat_src_code) ? "''" : "'".$this->db->escape($this->vat_src_code)."'").",";
|
||||
$sql .= " ".price2num($this->tva_tx).",";
|
||||
$sql .= " ".price2num($this->localtax1_tx).",";
|
||||
$sql .= " ".price2num($this->localtax2_tx).",";
|
||||
$sql .= " '".$this->db->escape($this->localtax1_type)."',";
|
||||
$sql .= " '".$this->db->escape($this->localtax2_type)."',";
|
||||
$sql .= ' '.((!empty($this->fk_product) && $this->fk_product > 0) ? $this->fk_product : "null").',';
|
||||
$sql .= " ".((int) $this->product_type).",";
|
||||
$sql .= " ".price2num($this->remise_percent).",";
|
||||
$sql .= ' '.(!empty($this->fk_remise_except) ? ((int) $this->fk_remise_except) : "null").',';
|
||||
$sql .= " ".price2num($this->subprice).",";
|
||||
$sql .= " ".(!empty($this->qty) ? price2num($this->total_ttc / $this->qty) : price2num($this->total_ttc)).",";
|
||||
$sql .= " ".(!empty($this->date_start) ? "'".$this->db->idate($this->date_start)."'" : "null").",";
|
||||
$sql .= " ".(!empty($this->date_end) ? "'".$this->db->idate($this->date_end)."'" : "null").",";
|
||||
$sql .= ' '.(!empty($this->fk_code_ventilation) ? $this->fk_code_ventilation : 0).',';
|
||||
$sql .= ' '.((int) $this->rang).',';
|
||||
$sql .= ' '.((int) $this->special_code).',';
|
||||
$sql .= " ".((int) $this->info_bits).",";
|
||||
$sql .= " ".price2num($this->total_ht).",";
|
||||
$sql .= " ".price2num($this->total_tva).",";
|
||||
$sql .= " ".price2num($this->total_ttc).",";
|
||||
$sql .= " ".price2num($this->total_localtax1).",";
|
||||
$sql .= " ".price2num($this->total_localtax2);
|
||||
$sql .= ", ".(!$this->fk_unit ? 'NULL' : $this->fk_unit);
|
||||
$sql .= ", ".(int) $this->fk_multicurrency;
|
||||
$sql .= ", '".$this->db->escape($this->multicurrency_code)."'";
|
||||
$sql .= ", ".price2num($this->multicurrency_subprice);
|
||||
$sql .= ", ".price2num($this->multicurrency_total_ht);
|
||||
$sql .= ", ".price2num($this->multicurrency_total_tva);
|
||||
$sql .= ", ".price2num($this->multicurrency_total_ttc);
|
||||
$sql .= ')';
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
||||
$this->rowid = $this->id; // backward compatibility
|
||||
|
||||
if (!$error) {
|
||||
$result = $this->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// Si fk_remise_except defini, on lie la remise a la facture
|
||||
// ce qui la flague comme "consommee".
|
||||
if ($this->fk_remise_except) {
|
||||
$discount = new DiscountAbsolute($this->db);
|
||||
$result = $discount->fetch($this->fk_remise_except);
|
||||
if ($result >= 0) {
|
||||
// Check if discount was found
|
||||
if ($result > 0) {
|
||||
// Check if discount not already affected to another invoice
|
||||
if ($discount->fk_facture_line > 0) {
|
||||
if (empty($noerrorifdiscountalreadylinked)) {
|
||||
$this->error = $langs->trans("ErrorDiscountAlreadyUsed", $discount->id);
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
} else {
|
||||
$result = $discount->link_to_invoice($this->id, 0);
|
||||
if ($result < 0) {
|
||||
$this->error = $discount->error;
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = $langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded");
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
} else {
|
||||
$this->error = $discount->error;
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('LINEBILL_SUPPLIER_CREATE', $user);
|
||||
if ($result < 0) {
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Mise a jour de l'objet ligne de commande en base
|
||||
*
|
||||
* @return int Return integer <0 si ko, >0 si ok
|
||||
*/
|
||||
public function update_total()
|
||||
{
|
||||
// phpcs:enable
|
||||
$this->db->begin();
|
||||
|
||||
// Mise a jour ligne en base
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";
|
||||
$sql .= " total_ht = ".price2num($this->total_ht);
|
||||
$sql .= ", tva= ".price2num($this->total_tva);
|
||||
$sql .= ", total_localtax1 = ".price2num($this->total_localtax1);
|
||||
$sql .= ", total_localtax2 = ".price2num($this->total_localtax2);
|
||||
$sql .= ", total_ttc = ".price2num($this->total_ttc);
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog("FactureFournisseurLigne.class.php::update_total", LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -544,8 +544,8 @@ if (empty($reshook)) {
|
|||
$label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : '');
|
||||
|
||||
// Update if prices fields are defined
|
||||
$tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id);
|
||||
$tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id);
|
||||
$tva_tx = get_default_tva($object->thirdparty, $mysoc, $prod->id);
|
||||
$tva_npr = get_default_npr($object->thirdparty, $mysoc, $prod->id);
|
||||
if (empty($tva_tx)) {
|
||||
$tva_npr = 0;
|
||||
}
|
||||
|
|
@ -553,7 +553,7 @@ if (empty($reshook)) {
|
|||
// Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp'].
|
||||
$pqp = (GETPOSTINT('pbq') ? GETPOSTINT('pbq') : 0);
|
||||
|
||||
$datapriceofproduct = $prod->getSellPrice($mysoc, $object->thirdparty, $pqp);
|
||||
$datapriceofproduct = $prod->getSellPrice($object->thirdparty, $mysoc, $pqp);
|
||||
|
||||
$pu_ht = $datapriceofproduct['pu_ht'];
|
||||
$pu_ttc = $datapriceofproduct['pu_ttc'];
|
||||
|
|
@ -668,8 +668,8 @@ if (empty($reshook)) {
|
|||
$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value
|
||||
|
||||
// Local Taxes
|
||||
$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr);
|
||||
$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr);
|
||||
$localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr);
|
||||
$localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr);
|
||||
$info_bits = 0;
|
||||
if ($tva_npr) {
|
||||
$info_bits |= 0x01;
|
||||
|
|
@ -1115,7 +1115,7 @@ if ($action == 'create') {
|
|||
$disableedit = 1;
|
||||
$disablemove = 1;
|
||||
$disableremove = 1;
|
||||
$object->printObjectLines('', $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
|
||||
$object->printObjectLines('', $object->thirdparty, $mysoc, $lineid, 0); // No date selector for template invoice
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
|
@ -1569,7 +1569,7 @@ if ($action == 'create') {
|
|||
$canchangeproduct = 0;
|
||||
|
||||
$object->statut = $object->suspended;
|
||||
$object->printObjectLines($action, $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
|
||||
$object->printObjectLines($action, $object->thirdparty, $mysoc, $lineid, 0); // No date selector for template invoice
|
||||
}
|
||||
|
||||
// Form to add new line
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ $search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $sea
|
|||
$search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear);
|
||||
$search_categ_sup = GETPOST("search_categ_sup", 'intcomma');
|
||||
$search_product_category = GETPOST('search_product_category', 'intcomma');
|
||||
$search_fk_fac_rec_source = GETPOST('search_fk_fac_rec_source', 'int');
|
||||
|
||||
$option = GETPOST('search_option');
|
||||
if ($option == 'late') {
|
||||
|
|
@ -645,6 +646,9 @@ if ($option == 'late') {
|
|||
if ($search_label) {
|
||||
$sql .= natural_search('f.libelle', $search_label);
|
||||
}
|
||||
if ($search_fk_fac_rec_source) {
|
||||
$sql .= " AND f.fk_fac_rec_source = ".(int) $search_fk_fac_rec_source;
|
||||
}
|
||||
// Search on sale representative
|
||||
if ($search_sale && $search_sale != '-1') {
|
||||
if ($search_sale == -2) {
|
||||
|
|
@ -817,6 +821,15 @@ if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sear
|
|||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-fourn-facture page-list');
|
||||
|
||||
if ($search_fk_fac_rec_source) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php';
|
||||
$object = new FactureFournisseurRec($db);
|
||||
$object->id = (int) $search_fk_fac_rec_source;
|
||||
$head = supplier_invoice_rec_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'generated', $langs->trans('InvoicesGeneratedFromRec'), -1, 'bill'); // Add a div
|
||||
}
|
||||
|
||||
if ($socid) {
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($socid);
|
||||
|
|
@ -949,6 +962,9 @@ if ($search_categ_sup > 0) {
|
|||
if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
|
||||
$param .= '&search_type_thirdparty='.$search_type_thirdparty;
|
||||
}
|
||||
if ($search_fk_fac_rec_source) {
|
||||
$param .= '&search_fk_fac_rec_source=' . (int) $search_fk_fac_rec_source;
|
||||
}
|
||||
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
|
|
|
|||
|
|
@ -605,11 +605,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$sk->fetch($t->skill_id);
|
||||
|
||||
print '<tr>';
|
||||
print ' <td>' . Skill::typeCodeToLabel($t->skill_type) . '</td>';
|
||||
print ' <td>' . $sk->getNomUrl(1) . '</td>';
|
||||
print ' <td>' . $t->description . '</td>';
|
||||
print ' <td align="center">' . $t->userRankForSkill . '</td>';
|
||||
print ' <td align="center">' . $t->required_rank . '</td>';
|
||||
print ' <td>' . dolPrintHTML(Skill::typeCodeToLabel($t->skill_type)) . '</td>';
|
||||
print ' <td class="tdoverflowmax200">' . $sk->getNomUrl(1) . '</td>';
|
||||
print ' <td class="tdoverflowmax200" title="'.dolPrintHTMLForAttribute($t->description).'">' . dolPrintHTML($t->description) . '</td>';
|
||||
print ' <td class="center">' . $t->userRankForSkill . '</td>';
|
||||
print ' <td class="center">' . $t->required_rank . '</td>';
|
||||
print ' <td>' . $t->result . '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ if (isModEnabled('holiday')) {
|
|||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder nohover centpercent">';
|
||||
print '<tr class="liste_titre"><th colspan="3">'.$langs->trans("Holidays").'</th></tr>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr class="oddeven nohover">';
|
||||
print '<td>';
|
||||
|
||||
$out = '';
|
||||
|
|
@ -195,7 +195,7 @@ print '</div><div class="secondcolumn fichehalfright boxhalfright" id="boxhalfri
|
|||
|
||||
// Latest modified leave requests
|
||||
if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) {
|
||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.photo, u.statut as user_status,";
|
||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.photo, u.gender, u.statut as user_status,";
|
||||
$sql .= " x.rowid, x.ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE u.rowid = x.fk_user";
|
||||
|
|
@ -216,7 +216,13 @@ if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) {
|
|||
$holidaystatic = new Holiday($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
$listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon"));
|
||||
$listhalfday = array(
|
||||
'morning'=>$langs->trans("Morning"),
|
||||
'morningshort'=>$langs->trans("Morning"),
|
||||
"afternoon"=>$langs->trans("Afternoon"),
|
||||
"afternoonshort"=>$langs->trans("Afternoon")
|
||||
);
|
||||
|
||||
$typeleaves = $holidaystatic->getTypes(1, -1);
|
||||
|
||||
$i = 0;
|
||||
|
|
@ -242,7 +248,7 @@ if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) {
|
|||
|
||||
$holidaystatic->id = $obj->rowid;
|
||||
$holidaystatic->ref = $obj->ref;
|
||||
$holidaystatic->statut = $obj->status;
|
||||
$holidaystatic->status = $obj->status;
|
||||
$holidaystatic->date_debut = $db->jdate($obj->date_start);
|
||||
|
||||
$userstatic->id = $obj->uid;
|
||||
|
|
@ -251,7 +257,7 @@ if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) {
|
|||
$userstatic->login = $obj->login;
|
||||
$userstatic->photo = $obj->photo;
|
||||
$userstatic->email = $obj->email;
|
||||
$userstatic->statut = $obj->user_status;
|
||||
$userstatic->gender = $obj->gender;
|
||||
$userstatic->status = $obj->user_status;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
|
@ -264,9 +270,17 @@ if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) {
|
|||
$starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning';
|
||||
$endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon';
|
||||
|
||||
print '<td class="tdoverflowmax125">'.dol_print_date($db->jdate($obj->date_start), 'dayreduceformat').' <span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).'</span>';
|
||||
print '<td class="tdoverflowmax125">'.dol_print_date($db->jdate($obj->date_end), 'dayreduceformat').' <span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).'</span>';
|
||||
print '<td class="right">'.dol_print_date($db->jdate($obj->dm), 'dayreduceformat').'</td>';
|
||||
print '<td class="tdoverflowmax125 center lineheightsmall">'.dol_print_date($db->jdate($obj->date_start), 'dayreduceformat');
|
||||
print '<br><span class="opacitymedium small" title="'.dolPrintHTML($langs->trans($listhalfday[$starthalfday])).'">';
|
||||
$labelshort = $langs->trans($listhalfday[$starthalfday.'short']) != $listhalfday[$starthalfday.'short'] ? $langs->trans($listhalfday[$starthalfday.'short']) : $langs->trans($listhalfday[$starthalfday]);
|
||||
print $labelshort;
|
||||
print '</span>';
|
||||
print '<td class="tdoverflowmax125 center lineheightsmall">'.dol_print_date($db->jdate($obj->date_end), 'dayreduceformat');
|
||||
print '<br><span class="opacitymedium small" title="'.dolPrintHTML($langs->trans($listhalfday[$endhalfday])).'">';
|
||||
$labelshort = $langs->trans($listhalfday[$endhalfday.'short']) != $listhalfday[$endhalfday.'short'] ? $langs->trans($listhalfday[$endhalfday.'short']) : $langs->trans($listhalfday[$starthalfday]);
|
||||
print $labelshort;
|
||||
print '</span>';
|
||||
print '<td class="right" title="'.$langs->trans("DateModification").': '.dol_print_date($db->jdate($obj->dm), 'dayhourreduceformat').'">'.dol_print_date($db->jdate($obj->dm), 'dayreduceformat').'</td>';
|
||||
print '<td class="right nowrap" width="16">'.$holidaystatic->LibStatut($obj->status, 3, $holidaystatic->date_debut).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
@ -286,7 +300,7 @@ if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) {
|
|||
|
||||
// Latest modified expense report
|
||||
if (isModEnabled('expensereport') && $user->hasRight('expensereport', 'read')) {
|
||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut as user_status, u.photo,";
|
||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut as user_status, u.photo, u.gender,";
|
||||
$sql .= " x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ht, x.total_ttc, x.fk_statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u";
|
||||
//if (empty($user->rights->societe->client->voir) && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
|
|
@ -339,6 +353,7 @@ if (isModEnabled('expensereport') && $user->hasRight('expensereport', 'read')) {
|
|||
$userstatic->email = $obj->email;
|
||||
$userstatic->login = $obj->login;
|
||||
$userstatic->status = $obj->user_status;
|
||||
$userstatic->gender = $obj->gender;
|
||||
$userstatic->photo = $obj->photo;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
|
|
|||
|
|
@ -268,6 +268,8 @@ ALTER TABLE llx_ticket ADD COLUMN origin_references text DEFAULT NULL;
|
|||
|
||||
ALTER TABLE llx_expensereport MODIFY COLUMN model_pdf varchar(255) DEFAULT NULL;
|
||||
ALTER TABLE llx_fichinter_rec MODIFY COLUMN modelpdf varchar(255) DEFAULT NULL;
|
||||
ALTER TABLE llx_hrm_evaluation MODIFY COLUMN modelpdf varchar(255) DEFAULT NULL;
|
||||
|
||||
ALTER TABLE llx_societe ADD COLUMN geolat double(24,8) DEFAULT NULL;
|
||||
ALTER TABLE llx_societe ADD COLUMN geolong double(24,8) DEFAULT NULL;
|
||||
ALTER TABLE llx_societe ADD COLUMN geopoint point DEFAULT NULL;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ ALTER TABLE llx_c_holiday_types DROP INDEX uk_c_holiday_types;
|
|||
ALTER TABLE llx_c_holiday_types ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
|
||||
ALTER TABLE llx_c_holiday_types ADD UNIQUE INDEX uk_c_holiday_types (entity, code);
|
||||
|
||||
ALTER TABLE llx_hrm_evaluation MODIFY COLUMN modelpdf varchar(255) DEFAULT NULL;
|
||||
|
||||
|
||||
|
||||
-- V21 migration
|
||||
|
||||
|
|
@ -157,6 +160,7 @@ ALTER TABLE llx_multicurrency ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP
|
|||
|
||||
ALTER TABLE llx_multicurrency_rate ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
|
||||
|
||||
ALTER TABLE llx_extrafields ADD COLUMN module varchar(64);
|
||||
|
||||
|
||||
-- Copy categories from llx_category_bank into llx_categorie
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ create table llx_extrafields
|
|||
fieldrequired integer DEFAULT 0,
|
||||
perms varchar(255), -- not used yet
|
||||
enabled varchar(255),
|
||||
module varchar(64),
|
||||
pos integer DEFAULT 0,
|
||||
alwayseditable integer DEFAULT 0, -- 1 if field can be edited whatever is element status
|
||||
param text, -- extra parameters to define possible values of field
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
-- Copyright (C) ---Put here your own copyright and developer email---
|
||||
-- Copyright (C) 2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software: you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
-- Copyright (C) 2019 Alicealalalamdskfldmjgdfgdfhfghgfh Adminson <testldr9@dolicloud.com>
|
||||
-- Copyright (C) 2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
-- Copyright (C) 2019 Alicealalalamdskfldmjgdfgdfhfghgfh Adminson <testldr9@dolicloud.com>
|
||||
-- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices (with a bank a
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=የክፍያ መጠየቂያዎች የስዊዘርላንድ ደረጃ; ዚፕ እና ከተማ መሞላታቸውን እና ሂሳቦቹ ትክክለኛ የስዊስ/ሊችተንስታይን IBANs እንዳላቸው ያረጋግጡ።
|
||||
INVOICE_ADD_EPC_QR_CODE=Show the EPC QR code on invoices (with a bank account defined for credit transfer)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=This feature allows you to add or remove an EPC QR Code on your invoices, which facilitates automatic SEPA credit transfers. Enabling this option helps your clients make payments easily by scanning the QR code, reducing manual entry errors. Use this feature if you have clients in countries like Austria, Belgium, Finland, Germany, and the Netherlands where this system is supported. Disable it if it's not required for your business operations or client base.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=የመላኪያ አድራሻ አሳይ
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=በአንዳንድ አገሮች ውስጥ አስገዳጅ ምልክት (ፈረንሳይ, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Show billing contact on proposal
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=Search unpaid supplier invoices with a v
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=Send reminder by email for validated and unpaid supplier invoices
|
||||
PaymentMadeForSeveralInvoices=Payment made for several invoices
|
||||
SituationInvoiceProgressCurrent=Invoice progress
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
|
|
|
|||
|
|
@ -2385,7 +2385,6 @@ INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices (with a bank a
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=Switzerland's standard for invoices; make sure ZIP & City are filled and that the accounts have valid Swiss/Liechtenstein IBANs.
|
||||
INVOICE_ADD_EPC_QR_CODE=Show the EPC QR code on invoices (with a bank account defined for credit transfer)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=This feature allows you to add or remove an EPC QR Code on your invoices, which facilitates automatic SEPA credit transfers. Enabling this option helps your clients make payments easily by scanning the QR code, reducing manual entry errors. Use this feature if you have clients in countries like Austria, Belgium, Finland, Germany, and the Netherlands where this system is supported. Disable it if it's not required for your business operations or client base.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=Show shipping address
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=Compulsory indication in some countries (France, ...)
|
||||
UrlSocialNetworksDesc=Url link of social network. Use {socialid} for the variable part that contains the social network ID.
|
||||
|
|
|
|||
|
|
@ -607,3 +607,4 @@ SearchUnpaidInvoicesWithDueDate=Search unpaid invoices with a due date = %s
|
|||
NoPaymentAvailable=No payment available for %s
|
||||
PaymentRegisteredAndInvoiceSetToPaid=Payment registered and invoice %s set to paid
|
||||
SendEmailsRemindersOnInvoiceDueDate=Send reminder by email for unpaid invoices
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices (with a bank a
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=معيار سويسرا للفواتير؛ تأكد من ملء الرمز البريدي والمدينة و وأن الحسابات تحتوي على أرقام IBAN صالحة في سويسرا/ليختنشتاين.
|
||||
INVOICE_ADD_EPC_QR_CODE=Show the EPC QR code on invoices (with a bank account defined for credit transfer)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=This feature allows you to add or remove an EPC QR Code on your invoices, which facilitates automatic SEPA credit transfers. Enabling this option helps your clients make payments easily by scanning the QR code, reducing manual entry errors. Use this feature if you have clients in countries like Austria, Belgium, Finland, Germany, and the Netherlands where this system is supported. Disable it if it's not required for your business operations or client base.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=عرض عنوان الشحن
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=الإشارة الإجبارية في بعض البلدان (فرنسا،...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Show billing contact on proposal
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=البحث عن فواتير مورد غ
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=إرسال تذكير عبر البريد الإلكتروني بشأن فواتير و غير المدفوعة مورد التي تم التحقق منها
|
||||
PaymentMadeForSeveralInvoices=تم الدفع لعدة فواتير
|
||||
SituationInvoiceProgressCurrent=Invoice progress
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices (with a bank a
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=İsveçrənin faktura standartı; ZIP və Şəhərin doldurulduğuna və hesabların etibarlı İsveçrə/Lixtenşteyn IBAN-larına malik olduğundan əmin olun.
|
||||
INVOICE_ADD_EPC_QR_CODE=Show the EPC QR code on invoices (with a bank account defined for credit transfer)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=This feature allows you to add or remove an EPC QR Code on your invoices, which facilitates automatic SEPA credit transfers. Enabling this option helps your clients make payments easily by scanning the QR code, reducing manual entry errors. Use this feature if you have clients in countries like Austria, Belgium, Finland, Germany, and the Netherlands where this system is supported. Disable it if it's not required for your business operations or client base.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=Göndərmə ünvanını göstərin
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=Bəzi ölkələrdə məcburi göstərici (Fransa, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Show billing contact on proposal
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=Search unpaid supplier invoices with a v
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=Send reminder by email for validated and unpaid supplier invoices
|
||||
PaymentMadeForSeveralInvoices=Payment made for several invoices
|
||||
SituationInvoiceProgressCurrent=Invoice progress
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices (with a bank a
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=Швейцарски стандарт за фактури; уверете се, че ZIP & City са попълнени и че сметките имат валидни IBAN за Швейцария/Лихтенщайн.
|
||||
INVOICE_ADD_EPC_QR_CODE=Show the EPC QR code on invoices (with a bank account defined for credit transfer)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=This feature allows you to add or remove an EPC QR Code on your invoices, which facilitates automatic SEPA credit transfers. Enabling this option helps your clients make payments easily by scanning the QR code, reducing manual entry errors. Use this feature if you have clients in countries like Austria, Belgium, Finland, Germany, and the Netherlands where this system is supported. Disable it if it's not required for your business operations or client base.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=Показване на доставка адрес
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=Задължително указание в някои страни (Франция, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Show billing contact on proposal
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=Търсете на неплатени
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=Изпратете напомняне по имейл за валидирани и неплатени фактури на доставчик
|
||||
PaymentMadeForSeveralInvoices=Плащане е направено за няколко фактури
|
||||
SituationInvoiceProgressCurrent=Invoice progress
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices (with a bank a
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=চালানের জন্য সুইজারল্যান্ডের মান; নিশ্চিত করুন যে ZIP এবং সিটি পূরণ করা হয়েছে এবং অ্যাকাউন্টগুলিতে বৈধ সুইস/লিচেনস্টাইন IBAN আছে।
|
||||
INVOICE_ADD_EPC_QR_CODE=Show the EPC QR code on invoices (with a bank account defined for credit transfer)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=This feature allows you to add or remove an EPC QR Code on your invoices, which facilitates automatic SEPA credit transfers. Enabling this option helps your clients make payments easily by scanning the QR code, reducing manual entry errors. Use this feature if you have clients in countries like Austria, Belgium, Finland, Germany, and the Netherlands where this system is supported. Disable it if it's not required for your business operations or client base.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=শিপিং ঠিকানা দেখান
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=কিছু দেশে বাধ্যতামূলক ইঙ্গিত (ফ্রান্স, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Show billing contact on proposal
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=Search unpaid supplier invoices with a v
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=Send reminder by email for validated and unpaid supplier invoices
|
||||
PaymentMadeForSeveralInvoices=Payment made for several invoices
|
||||
SituationInvoiceProgressCurrent=Invoice progress
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices (with a bank a
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=চালানের জন্য সুইজারল্যান্ডের মান; নিশ্চিত করুন যে ZIP এবং সিটি পূরণ করা হয়েছে এবং অ্যাকাউন্টগুলিতে বৈধ সুইস/লিচেনস্টাইন IBAN আছে।
|
||||
INVOICE_ADD_EPC_QR_CODE=Show the EPC QR code on invoices (with a bank account defined for credit transfer)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=This feature allows you to add or remove an EPC QR Code on your invoices, which facilitates automatic SEPA credit transfers. Enabling this option helps your clients make payments easily by scanning the QR code, reducing manual entry errors. Use this feature if you have clients in countries like Austria, Belgium, Finland, Germany, and the Netherlands where this system is supported. Disable it if it's not required for your business operations or client base.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=শিপিং ঠিকানা দেখান
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=কিছু দেশে বাধ্যতামূলক ইঙ্গিত (ফ্রান্স, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Show billing contact on proposal
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=Search unpaid supplier invoices with a v
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=Send reminder by email for validated and unpaid supplier invoices
|
||||
PaymentMadeForSeveralInvoices=Payment made for several invoices
|
||||
SituationInvoiceProgressCurrent=Invoice progress
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices (with a bank a
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=švicarski standard za fakture; provjerite jesu li ZIP & City popunjeni i da računi imaju važeće švicarske/lihtenštajnske IBAN-ove.
|
||||
INVOICE_ADD_EPC_QR_CODE=Show the EPC QR code on invoices (with a bank account defined for credit transfer)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=This feature allows you to add or remove an EPC QR Code on your invoices, which facilitates automatic SEPA credit transfers. Enabling this option helps your clients make payments easily by scanning the QR code, reducing manual entry errors. Use this feature if you have clients in countries like Austria, Belgium, Finland, Germany, and the Netherlands where this system is supported. Disable it if it's not required for your business operations or client base.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=Pokaži adresu za dostavu
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=Obavezna indikacija u nekim zemljama (Francuska, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Show billing contact on proposal
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=Search unpaid supplier invoices with a v
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=Send reminder by email for validated and unpaid supplier invoices
|
||||
PaymentMadeForSeveralInvoices=Payment made for several invoices
|
||||
SituationInvoiceProgressCurrent=Invoice progress
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Mostra el codi QR-Bill suís a les factures (amb un co
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=Estàndard de Suïssa per a les factures; Assegureu-vos que s'omplen ZIP & City i que els comptes tinguin IBAN vàlids de Suïssa/Liechtenstein.
|
||||
INVOICE_ADD_EPC_QR_CODE=Mostra el codi QR EPC a les factures (amb un compte bancari definit per a la transferència de crèdit)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=Aquesta funció us permet afegir o eliminar un codi QR EPC a les vostres factures, cosa que facilita les transferències de crèdit SEPA automàtiques. Habilitar aquesta opció ajuda els vostres clients a fer pagaments fàcilment escanejant el codi QR, reduint els errors d'entrada manual. Utilitzeu aquesta funció si teniu clients a països com Àustria, Bèlgica, Finlàndia, Alemanya i els Països Baixos on aquest sistema és compatible. Desactiveu-lo si no és necessari per a les vostres operacions comercials o base de clients.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Escaneja aquest codi QR per pagar amb un telèfon intel·ligent que admeti el pagament amb el codi QR EPC.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=Mostra l'adreça d'enviament
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=Indicació obligatòria en alguns països (França, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Show billing contact on proposal
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=Cerca factures de proveïdors no pagades
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=Envieu un recordatori per correu electrònic per a les factures de proveïdors validades i no pagades
|
||||
PaymentMadeForSeveralInvoices=Pagament realitzat per diverses factures
|
||||
SituationInvoiceProgressCurrent=Progrés de la factura
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Escaneja aquest codi QR per pagar amb un telèfon intel·ligent que admeti el pagament amb el codi QR EPC.
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices (with a bank a
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=Switzerland's standard for invoices; make sure ZIP & City are filled and that the accounts have valid Swiss/Liechtenstein IBANs.
|
||||
INVOICE_ADD_EPC_QR_CODE=Show the EPC QR code on invoices (with a bank account defined for credit transfer)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=This feature allows you to add or remove an EPC QR Code on your invoices, which facilitates automatic SEPA credit transfers. Enabling this option helps your clients make payments easily by scanning the QR code, reducing manual entry errors. Use this feature if you have clients in countries like Austria, Belgium, Finland, Germany, and the Netherlands where this system is supported. Disable it if it's not required for your business operations or client base.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=Show shipping address
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=Compulsory indication in some countries (France, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Show billing contact on proposal
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=Search unpaid supplier invoices with a v
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=Send reminder by email for validated and unpaid supplier invoices
|
||||
PaymentMadeForSeveralInvoices=Payment made for several invoices
|
||||
SituationInvoiceProgressCurrent=Invoice progress
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices (with a bank a
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=safon y Swistir ar gyfer anfonebau; gwnewch yn siŵr bod ZIP & City wedi'u llenwi a bod gan y cyfrifon IBANs Swistir/Liechtenstein dilys.
|
||||
INVOICE_ADD_EPC_QR_CODE=Show the EPC QR code on invoices (with a bank account defined for credit transfer)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=This feature allows you to add or remove an EPC QR Code on your invoices, which facilitates automatic SEPA credit transfers. Enabling this option helps your clients make payments easily by scanning the QR code, reducing manual entry errors. Use this feature if you have clients in countries like Austria, Belgium, Finland, Germany, and the Netherlands where this system is supported. Disable it if it's not required for your business operations or client base.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=Dangos cyfeiriad cludo
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=Arwydd gorfodol mewn rhai gwledydd (Ffrainc, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Show billing contact on proposal
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=Chwiliwch am anfonebau cyflenwyr heb eu
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=Anfonwch nodyn atgoffa trwy e-bost ar gyfer anfonebau cyflenwyr sydd wedi'u dilysu a heb eu talu
|
||||
PaymentMadeForSeveralInvoices=Talwyd am sawl anfoneb
|
||||
SituationInvoiceProgressCurrent=Invoice progress
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan this QR code to pay with a smartphone supporting payment with EPC QR code.
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Vis den schweiziske QR-Bill-kode på fakturaer (med en
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=Schweiz' standard for fakturaer; sørg for, at ZIP & City er udfyldt, og at konti har gyldige schweiziske/liechtensteinske IBAN.
|
||||
INVOICE_ADD_EPC_QR_CODE=Vis EPC QR-koden på fakturaer (med en bankkonto defineret til kreditoverførsel)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=Denne funktion giver dig mulighed for at tilføje eller fjerne en EPC QR-kode på dine fakturaer, hvilket letter automatiske SEPA-kreditoverførsler. Aktivering af denne mulighed hjælper dine kunder med at foretage betalinger nemt ved at scanne QR-koden, hvilket reducerer manuelle indtastningsfejl. Brug denne funktion, hvis du har kunder i lande som Østrig, Belgien, Finland, Tyskland og Holland, hvor dette system understøttes. Deaktiver det, hvis det ikke er nødvendigt for din virksomhedsdrift eller kundebase.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan denne QR-kode for at betale med en smartphone, der understøtter betaling med EPC QR-kode.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=Vis leveringsadresse
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=Obligatorisk angivelse i nogle lande (Frankrig, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Vis faktureringskontakt på forslag
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=Søg efter ubetalte leverandørfakturaer
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=Send påmindelse på e-mail for validerede og ubetalte leverandørfakturaer
|
||||
PaymentMadeForSeveralInvoices=Betaling foretaget for flere fakturaer
|
||||
SituationInvoiceProgressCurrent=Fakturafremdrift
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Scan denne QR-kode for at betale med en smartphone, der understøtter betaling med EPC QR-kode.
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Schweizer QR-Rechnungscode auf Rechnungen anzeigen (mi
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=Schweizer Standard für Rechnungen; Stellen Sie sicher, dass PLZ und Ort ausgefüllt sind und dass die Konten über gültige Schweizer/Liechtenstein-IBANs verfügen.
|
||||
INVOICE_ADD_EPC_QR_CODE=EPC-QR-Code auf Rechnungen anzeigen (mit einem festgelegten Bankkonto für Überweisungen)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=Mit diesem Funktion können Sie einen EPC-QR-Code auf Ihrem Rechnungen hinzufügen oder diesen entfernen, der automatische SEPA-Überweisungen erleichtert. Durch Aktivieren dieser Option können Ihre Kunden Zahlungen ganz einfach durch Scannen des QR-Codes durchführen, wodurch manuelle Eingabefehler reduziert werden. Verwenden Sie dieses Funktion, wenn Sie Kunden in Ländern wie Österreich, Belgien, Finnland, Deutschland oder den Niederlanden haben, in denen dieses System unterstützt wird. Deaktivieren Sie es, wenn es für Ihren Geschäftsbetrieb oder Ihren Kundenstamm nicht erforderlich ist.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Diesen QR-Code scannen, um mit einem Smartphone zu bezahlen, das Zahlungen mit EPC-QR-Code unterstützt.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=Lieferadresse anzeigen
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=Obligatorische Angabe für manche Länder (Frankreich, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Rechnungskontakt auf Angebot anzeigen
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=Suche nach unbezahlten Lieferantenrechnu
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=Eine Erinnerung per E-Mail für freigegebene und unbezahlte Lieferantenrechnungen senden
|
||||
PaymentMadeForSeveralInvoices=Zahlung erfolgt für mehrere Rechnungen
|
||||
SituationInvoiceProgressCurrent=Rechnungsfortschritt
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Diesen QR-Code scannen, um mit einem Smartphone zu bezahlen, das Zahlungen mit EPC-QR-Code unterstützt.
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Εμφάνιση του ελβετικού κωδικ
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=Ελβετικό πρότυπο για τα τιμολόγια. βεβαιωθείτε ότι τα πεδία Τ.Κ, & πόλη είναι συμπληρωμένα και ότι οι λογαριασμοί έχουν έγκυρα IBAN Ελβετίας/Λιχτενστάιν.
|
||||
INVOICE_ADD_EPC_QR_CODE=Εμφάνιση του κωδικού EPC QR στα τιμολόγια (με τραπεζικό λογαριασμό που έχει οριστεί για μεταφορά πίστωσης)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=Αυτή η λειτουργία σάς επιτρέπει να προσθέσετε ή να αφαιρέσετε έναν κωδικό EPC QR απο τα τιμολόγιά σας, ο οποίος διευκολύνει τις αυτόματες μεταφορές πίστωσης SEPA. Η ενεργοποίηση αυτής της επιλογής βοηθά τους πελάτες σας να πραγματοποιούν πληρωμές εύκολα σαρώνοντας τον κωδικό QR, μειώνοντας τα σφάλματα χειροκίνητης εισαγωγής. Χρησιμοποιήστε αυτήν τη δυνατότητα εάν έχετε πελάτες σε χώρες όπως η Αυστρία, το Βέλγιο, η Φινλανδία, η Γερμανία, και η Ολλανδία όπου υποστηρίζεται αυτό το σύστημα. Απενεργοποιήστε το εάν δεν απαιτείται για τις επιχειρηματικές δραστηριότητες ή τη βάση πελατών σας.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Σαρώστε αυτόν τον κωδικό QR για να πληρώσετε με ένα smartphone που υποστηρίζει πληρωμή με κωδικό EPC QR.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=Εμφάνιση διεύθυνσης αποστολής
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=Υποχρεωτική αναφορά για κάποιες χώρες (Γαλλία, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Εμφάνιση επαφή χρέωσης στην προσφορά
|
||||
|
|
|
|||
|
|
@ -669,3 +669,4 @@ SearchValidatedSupplierInvoicesWithDate=Αναζήτηση απλήρωτων τ
|
|||
SendEmailsRemindersOnSupplierInvoiceDueDate=Αποστολή υπενθύμισης μέσω email για επικυρωμένα και απλήρωτα τιμολόγια προμηθευτών
|
||||
PaymentMadeForSeveralInvoices=Πληρωμή που έγινε για αρκετά τιμολόγια
|
||||
SituationInvoiceProgressCurrent=Πρόοδος τιμολογίου
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Σαρώστε αυτόν τον κωδικό QR για να πληρώσετε με ένα smartphone που υποστηρίζει πληρωμή με κωδικό EPC QR.
|
||||
|
|
|
|||
|
|
@ -2573,3 +2573,6 @@ SALES_ORDER_SHOW_SHIPPING_ADDRESS=Show shipping address
|
|||
SALES_ORDER_SHOW_SHIPPING_ADDRESSMore=Compulsory indication in some countries (France, ...)
|
||||
MaxNbOfRecordOnListIsOk=You have a max size for lists is set to <b>%s</b> lines. This is a good value.
|
||||
YouHaveALargeAmountOfRecordOnLists=You have a default max size for lists set to <b>%s</b> lines. This is a large value that need scrolling to see all answers. It is better to have a value lower than <b>%s</b> and use pagination to see record over this number. Change this in menu Home - Setup - Display.
|
||||
RoundBorders=Round borders
|
||||
CheckIfModuleIsNotBlackListed=Block install for modules found into the <b>Remote blacklist</b>
|
||||
CheckIfModuleIsNotBlackListedHelp=Some modules may be provided by some companies that do not respect the project's rules of goodwill (non-compliance with GDPR, violation of the rules tof use the Dolibarr brand name, etc.). By checking this box, a request will be made to the project server to see if a report was received about this module, and will protect you by blocking the deployment of flagged modules
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ BillTo=To
|
|||
ShippingTo=Shipping to
|
||||
ActionsOnBill=Actions on invoice
|
||||
ActionsOnBillRec=Actions on recurring invoice
|
||||
InvoicesGeneratedFromRec=Generated invoices
|
||||
RecurringInvoiceTemplate=Template / Recurring invoice
|
||||
NoQualifiedRecurringInvoiceTemplateFound=No recurring template invoice qualified for generation.
|
||||
FoundXQualifiedRecurringInvoiceTemplate=%s recurring template invoice(s) qualified for generation.
|
||||
|
|
|
|||
|
|
@ -391,6 +391,9 @@ WarningReadBankAlsoAllowedIfUserHasPermission=Warning, reading bank account is a
|
|||
WarningNoDataTransferedInAccountancyYet=Please note, there is no data in the accounting table. Please transfer your data recorded in the application to the accounting section or change the calculation mode to analyze the data recorded outside of accounting.
|
||||
WarningChangingThisMayBreakStopTaskScheduler=Warning, changing this value may disable the scheduler
|
||||
WarningAmountOfFileDiffersFromSumOfLines=Warning, amount of file (%s) differs from the sum of lines (%s)
|
||||
WarningModuleAffiliatedToAReportedCompany=Warning, this module has been reported to the Dolibarr foundation as being published by a company using illegal practices (non-compliance with the rules for using the Dolibarr brand, collecting your data without your consent or deploying malware).
|
||||
WarningModuleAffiliatedToAPiratPlatform=Be careful when getting a module (paid or free) from a suspicious non official platform like %s
|
||||
|
||||
SwissQrOnlyVIR = SwissQR invoice can only be added on invoices set to be paid with credit transfer payments.
|
||||
SwissQrCreditorAddressInvalid = Creditor address is invalid (are ZIP and city set? (%s)
|
||||
SwissQrCreditorInformationInvalid = Creditor information is invalid for IBAN (%s): %s
|
||||
|
|
|
|||
|
|
@ -400,6 +400,8 @@ ErrorDestinationProductNotFound=Destination product not found
|
|||
ErrorProductCombinationNotFound=Product variant not found
|
||||
ActionAvailableOnVariantProductOnly=Action only available on the variant of product
|
||||
ProductsPricePerCustomer=Product prices per customers
|
||||
ProductLevelExtraFields=Additional Attributes (Level price)
|
||||
ProductCustomerExtraFields=Additional Attributes (Customer price)
|
||||
ProductSupplierExtraFields=Additional Attributes (Supplier Prices)
|
||||
DeleteLinkedProduct=Delete the child product linked to the combination
|
||||
AmountUsedToUpdateWAP=Unit amount to use to update the Weighted Average Price
|
||||
|
|
|
|||
|
|
@ -2393,7 +2393,6 @@ INVOICE_ADD_SWISS_QR_CODE=Mostrar el código QR-Bill suizo en las facturas (con
|
|||
INVOICE_ADD_SWISS_QR_CODEMore=Estándar de Suiza para las facturas; asegúrese de que el código postal y la ciudad estén completos y que las cuentas tengan IBAN de Suiza/Liechtenstein válidos.
|
||||
INVOICE_ADD_EPC_QR_CODE=Mostrar el código QR EPC en las facturas (con una cuenta bancaria definida para transferencia de crédito)
|
||||
INVOICE_ADD_EPC_QR_CODEMore=Esta función le permite agregar o eliminar un código QR EPC en sus facturas, lo que facilita las transferencias de crédito SEPA automáticas. Habilitar esta opción ayuda a sus clientes a realizar pagos fácilmente escaneando el código QR, lo que reduce los errores de entrada manual. Utilice esta función si tiene clientes en países como Austria, Bélgica, Finlandia, Alemania y los Países Bajos donde se admite este sistema. Deshabilítelo si no es necesario para sus operaciones comerciales o su base de clientes.
|
||||
INVOICE_ADD_EPC_QR_CODEPay=Escanee este código QR para pagar con un teléfono inteligente que admita pagos con código QR EPC.
|
||||
INVOICE_SHOW_SHIPPING_ADDRESS=Mostrar dirección de envío
|
||||
INVOICE_SHOW_SHIPPING_ADDRESSMore=Indicación obligatoria en algunos países (Francia, ...)
|
||||
SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT=Show billing contact on proposal
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue