Fix import supplier product price vat
This commit is contained in:
parent
bf7ae08c48
commit
930d58ab96
@ -299,15 +299,18 @@ class modProduct extends DolibarrModules
|
|||||||
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||||
$this->import_tables_array[$r]=array('sp'=>MAIN_DB_PREFIX.'product_fournisseur_price');
|
$this->import_tables_array[$r]=array('sp'=>MAIN_DB_PREFIX.'product_fournisseur_price');
|
||||||
$this->import_tables_creator_array[$r]=array('sp'=>'fk_user');
|
$this->import_tables_creator_array[$r]=array('sp'=>'fk_user');
|
||||||
$this->import_fields_array[$r]=array('sp.fk_product'=>"ProductOrService*",
|
$this->import_fields_array[$r]=array(
|
||||||
'sp.fk_soc'=>"Supplier*", 'sp.ref_fourn'=>'SupplierRef', 'sp.quantity'=>"QtyMin*", 'sp.tva_tx'=>'VATRate',
|
'sp.fk_product'=>"ProductOrService*",
|
||||||
|
'sp.fk_soc'=>"Supplier*", 'sp.ref_fourn'=>'SupplierRef', 'sp.quantity'=>"QtyMin*", 'sp.tva_tx'=>'VATRate', 'sp.default_vat_code'=>'VATCode'
|
||||||
|
);
|
||||||
|
if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('sp.recuperableonly'=>'VATNPR'));
|
||||||
|
if (is_object($mysoc) && $mysoc->useLocalTax(1)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('sp.localtax1_tx'=>'LT1', 'sp.localtax1_type'=>'LT1Type'));
|
||||||
|
if (is_object($mysoc) && $mysoc->useLocalTax(2)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('sp.localtax2_tx'=>'LT2', 'sp.localtax2_type'=>'LT2Type'));
|
||||||
|
$this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array(
|
||||||
'sp.price'=>"PriceQtyMinHT*",
|
'sp.price'=>"PriceQtyMinHT*",
|
||||||
'sp.unitprice'=>'UnitPriceHT*', // TODO Make this field not required and calculate it from price and qty
|
'sp.unitprice'=>'UnitPriceHT*', // TODO Make this field not required and calculate it from price and qty
|
||||||
'sp.remise_percent'=>'DiscountQtyMin'
|
'sp.remise_percent'=>'DiscountQtyMin'
|
||||||
);
|
));
|
||||||
if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('sp.recuperableonly'=>'NPR'));
|
|
||||||
if (is_object($mysoc) && $mysoc->useLocalTax(1)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('sp.localtax1_tx'=>'LT1', 'sp.localtax1_type'=>'LT1Type'));
|
|
||||||
if (is_object($mysoc) && $mysoc->useLocalTax(2)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('sp.localtax2_tx'=>'LT2', 'sp.localtax2_type'=>'LT2Type'));
|
|
||||||
$this->import_convertvalue_array[$r]=array(
|
$this->import_convertvalue_array[$r]=array(
|
||||||
'sp.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
|
'sp.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
|
||||||
'sp.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'Product')
|
'sp.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'Product')
|
||||||
|
|||||||
@ -272,12 +272,18 @@ class modService extends DolibarrModules
|
|||||||
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||||
$this->import_tables_array[$r]=array('sp'=>MAIN_DB_PREFIX.'product_fournisseur_price');
|
$this->import_tables_array[$r]=array('sp'=>MAIN_DB_PREFIX.'product_fournisseur_price');
|
||||||
$this->import_tables_creator_array[$r]=array('sp'=>'fk_user');
|
$this->import_tables_creator_array[$r]=array('sp'=>'fk_user');
|
||||||
$this->import_fields_array[$r]=array('sp.fk_product'=>"ProductOrService*",
|
$this->import_fields_array[$r]=array(
|
||||||
'sp.fk_soc'=>"Supplier*", 'sp.ref_fourn'=>'SupplierRef', 'sp.quantity'=>"QtyMin*", 'sp.tva_tx'=>'VATRate',
|
'sp.fk_product'=>"ProductOrService*",
|
||||||
'sp.price'=>"PriceQtyMinHT*",
|
'sp.fk_soc'=>"Supplier*", 'sp.ref_fourn'=>'SupplierRef', 'sp.quantity'=>"QtyMin*", 'sp.tva_tx'=>'VATRate', 'sp.default_vat_code'=>'VATCode'
|
||||||
'sp.unitprice'=>'UnitPriceHT*', // TODO Make this file not required and calculate it from price and qty
|
|
||||||
'sp.remise_percent'=>'DiscountQtyMin'
|
|
||||||
);
|
);
|
||||||
|
if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('sp.recuperableonly'=>'VATNPR'));
|
||||||
|
if (is_object($mysoc) && $mysoc->useLocalTax(1)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('sp.localtax1_tx'=>'LT1', 'sp.localtax1_type'=>'LT1Type'));
|
||||||
|
if (is_object($mysoc) && $mysoc->useLocalTax(2)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('sp.localtax2_tx'=>'LT2', 'sp.localtax2_type'=>'LT2Type'));
|
||||||
|
$this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array(
|
||||||
|
'sp.price'=>"PriceQtyMinHT*",
|
||||||
|
'sp.unitprice'=>'UnitPriceHT*', // TODO Make this field not required and calculate it from price and qty
|
||||||
|
'sp.remise_percent'=>'DiscountQtyMin'
|
||||||
|
));
|
||||||
|
|
||||||
$this->import_convertvalue_array[$r]=array(
|
$this->import_convertvalue_array[$r]=array(
|
||||||
'sp.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
|
'sp.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
|
||||||
|
|||||||
@ -411,7 +411,7 @@ class modSociete extends DolibarrModules
|
|||||||
$r++;
|
$r++;
|
||||||
$this->import_code[$r]=$this->rights_class.'_'.$r;
|
$this->import_code[$r]=$this->rights_class.'_'.$r;
|
||||||
$this->import_label[$r]="ImportDataset_company_3"; // Translation key
|
$this->import_label[$r]="ImportDataset_company_3"; // Translation key
|
||||||
$this->import_icon[$r]='account';
|
$this->import_icon[$r]='company';
|
||||||
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||||
$this->import_tables_array[$r]=array('sr'=>MAIN_DB_PREFIX.'societe_rib');
|
$this->import_tables_array[$r]=array('sr'=>MAIN_DB_PREFIX.'societe_rib');
|
||||||
$this->import_fields_array[$r]=array('sr.fk_soc'=>"ThirdPartyName*",'sr.bank'=>"Bank",
|
$this->import_fields_array[$r]=array('sr.fk_soc'=>"ThirdPartyName*",'sr.bank'=>"Bank",
|
||||||
|
|||||||
@ -377,8 +377,8 @@ ExportDataset_company_1=Third parties (Companies / foundations / physical people
|
|||||||
ExportDataset_company_2=Contacts and properties
|
ExportDataset_company_2=Contacts and properties
|
||||||
ImportDataset_company_1=Third parties (Companies / foundations / physical people) and properties
|
ImportDataset_company_1=Third parties (Companies / foundations / physical people) and properties
|
||||||
ImportDataset_company_2=Contacts/Addresses (of thirdparties or not) and attributes
|
ImportDataset_company_2=Contacts/Addresses (of thirdparties or not) and attributes
|
||||||
ImportDataset_company_3=Bank details
|
ImportDataset_company_3=Bank accounts of thirdparties
|
||||||
ImportDataset_company_4=Third parties/Sales representatives (Affect sales representatives users to companies)
|
ImportDataset_company_4=Third parties/Sales representatives (Assign sales representatives users to companies)
|
||||||
PriceLevel=Price level
|
PriceLevel=Price level
|
||||||
DeliveryAddress=Delivery address
|
DeliveryAddress=Delivery address
|
||||||
AddAddress=Add address
|
AddAddress=Add address
|
||||||
|
|||||||
@ -389,6 +389,8 @@ LT2ES=IRPF
|
|||||||
LT1IN=CGST
|
LT1IN=CGST
|
||||||
LT2IN=SGST
|
LT2IN=SGST
|
||||||
VATRate=Tax Rate
|
VATRate=Tax Rate
|
||||||
|
VATCode=Tax Rate code
|
||||||
|
VATNPR=Tax Rate NPR
|
||||||
DefaultTaxRate=Default tax rate
|
DefaultTaxRate=Default tax rate
|
||||||
Average=Average
|
Average=Average
|
||||||
Sum=Sum
|
Sum=Sum
|
||||||
|
|||||||
@ -26,9 +26,7 @@ require '../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
|
||||||
|
|
||||||
// Load translations files required by page
|
// Load translations files required by page
|
||||||
$langs->load("resource");
|
$langs->loadLangs(array("resource","companies","other"));
|
||||||
$langs->load("companies");
|
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
// Get parameters
|
// Get parameters
|
||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
@ -89,7 +87,7 @@ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&con
|
|||||||
$hookmanager->initHooks(array('resource_list'));
|
$hookmanager->initHooks(array('resource_list'));
|
||||||
|
|
||||||
if (empty($sortorder)) $sortorder="ASC";
|
if (empty($sortorder)) $sortorder="ASC";
|
||||||
if (empty($sortfield)) $sortfield="t.rowid";
|
if (empty($sortfield)) $sortfield="t.ref";
|
||||||
if (empty($arch)) $arch = 0;
|
if (empty($arch)) $arch = 0;
|
||||||
|
|
||||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
|
|||||||
@ -3598,7 +3598,7 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; }
|
|||||||
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
|
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
|
||||||
.cal_event_busy a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); }
|
.cal_event_busy a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); }
|
||||||
.cal_event_busy { }
|
.cal_event_busy { }
|
||||||
.cal_peruserviewname { max-width: 100px; height: 22px; }
|
.cal_peruserviewname { max-width: 140px; height: 22px; }
|
||||||
|
|
||||||
|
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
|
|||||||
@ -3649,7 +3649,7 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; }
|
|||||||
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
|
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
|
||||||
.cal_event_busy a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); }
|
.cal_event_busy a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); }
|
||||||
.cal_event_busy { }
|
.cal_event_busy { }
|
||||||
.cal_peruserviewname { max-width: 100px; height: 22px; }
|
.cal_peruserviewname { max-width: 140px; height: 22px; }
|
||||||
|
|
||||||
.topmenuimage {
|
.topmenuimage {
|
||||||
background-size: 28px auto;
|
background-size: 28px auto;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user