mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge pull request #18116 from aspangaro/14p3
FIX Accountancy - constant ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY
This commit is contained in:
commit
512f58a34a
|
|
@ -201,11 +201,13 @@ if ($action == 'validatehistory') {
|
|||
}
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_sell)) {
|
||||
$objp->code_sell_t = $objp->company_code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_sell)) {
|
||||
$objp->code_sell_t = $objp->company_code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
}
|
||||
|
||||
if ($objp->aarowid_suggest > 0) {
|
||||
|
|
|
|||
|
|
@ -202,11 +202,13 @@ if ($action == 'validatehistory') {
|
|||
}
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_buy)) {
|
||||
$objp->code_buy_t = $objp->company_code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_buy)) {
|
||||
$objp->code_buy_t = $objp->company_code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
}
|
||||
|
||||
if ($objp->aarowid_suggest > 0) {
|
||||
|
|
|
|||
|
|
@ -495,10 +495,22 @@ if (empty($reshook)) {
|
|||
$object->webservices_key = GETPOST('webservices_key', 'san_alpha');
|
||||
|
||||
if (GETPOSTISSET('accountancy_code_sell')) {
|
||||
$object->accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
|
||||
$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
|
||||
|
||||
if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
|
||||
$object->accountancy_code_sell = '';
|
||||
} else {
|
||||
$object->accountancy_code_sell = $accountancy_code_sell;
|
||||
}
|
||||
}
|
||||
if (GETPOSTISSET('accountancy_code_buy')) {
|
||||
$object->accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
|
||||
$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
|
||||
|
||||
if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
|
||||
$object->accountancy_code_buy = '';
|
||||
} else {
|
||||
$object->accountancy_code_buy = $accountancy_code_buy;
|
||||
}
|
||||
}
|
||||
|
||||
// Incoterms
|
||||
|
|
@ -1058,10 +1070,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
$object->default_lang = GETPOST('default_lang');
|
||||
|
||||
if (GETPOSTISSET('accountancy_code_sell')) {
|
||||
$object->accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
|
||||
$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
|
||||
|
||||
if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
|
||||
$object->accountancy_code_sell = '';
|
||||
} else {
|
||||
$object->accountancy_code_sell = $accountancy_code_sell;
|
||||
}
|
||||
}
|
||||
if (GETPOSTISSET('accountancy_code_buy')) {
|
||||
$object->accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
|
||||
$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
|
||||
|
||||
if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
|
||||
$object->accountancy_code_buy = '';
|
||||
} else {
|
||||
$object->accountancy_code_buy = $accountancy_code_buy;
|
||||
}
|
||||
}
|
||||
|
||||
$object->logo = (isset($_FILES['photo']) ?dol_sanitizeFileName($_FILES['photo']['name']) : '');
|
||||
|
|
@ -1785,10 +1809,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
$object->webservices_key = GETPOST('webservices_key', 'san_alpha');
|
||||
|
||||
if (GETPOSTISSET('accountancy_code_sell')) {
|
||||
$object->accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
|
||||
$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
|
||||
|
||||
if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
|
||||
$object->accountancy_code_sell = '';
|
||||
} else {
|
||||
$object->accountancy_code_sell = $accountancy_code_sell;
|
||||
}
|
||||
}
|
||||
if (GETPOSTISSET('accountancy_code_buy')) {
|
||||
$object->accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
|
||||
$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
|
||||
|
||||
if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
|
||||
$object->accountancy_code_buy = '';
|
||||
} else {
|
||||
$object->accountancy_code_buy = $accountancy_code_buy;
|
||||
}
|
||||
}
|
||||
|
||||
//Incoterms
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user