Commit old changes

This commit is contained in:
2024-09-30 08:44:00 +00:00
parent 01c92080cd
commit 6a37a77895
20 changed files with 581 additions and 956 deletions

View File

@@ -39,13 +39,13 @@
echo '<a target="new" href="https://crm.e5.pl/index.php?module=EcmSales&action=DetailView&record='.$exists['id'].'">'.$exists['document_no'].'</a>';
die();
}
$res = makeCUrlRequest("https://crm.twinpol.com/REST/index.php?key=d68dac4c-f784-4e1b-8267-9ffcfa0eda4c&action=getSale&record=".$record);
$sale = json_decode($res);
$sale->position_list = json_decode($sale->position_list);
echo "Numer dokumentu TwinPol: <b>".$sale->document_no."</b><br>";
$gotAllProducts = true; // hope :)
$gotAllProducts = true; // hope :)
$newPositionList = array();
$total_netto = 0; $total_brutto = 0; $total_discount = 0; $vats = array();
foreach ( $sale->position_list as $product ) {
@@ -84,7 +84,7 @@
}
$prod['quantity'] = $product->quantity;
$prod['discount'] = $product->discount;
$prod['price_start'] = $price_start;
$prod['price_start'] = $price_start;
$prod['price_netto'] = round($price_start - ($price_start * ($product->discount / 100)),2);
$prod['ecmvat_id'] = $fvPrice['ecmvat_id'];
$prod['ecmvat_value'] = $fvPrice['ecmvat_value'];
@@ -105,7 +105,7 @@
$prod['date_entered'] = date('Y-m-d H:i:s');
$prod['date_modified'] = date('Y-m-d H:i:s');
$prod['modified_user_id'] = null;
$prod['modified_user_id'] = null;
$prod['assigned_user_id'] = null;
$prod['created_by'] = null;
$prod['deleted'] = '0';
@@ -167,7 +167,7 @@
$new->shipping_nip = $sale->parent_nip;
$new->edi_zs_id = $sale->id;
$new->edi_zs_document_no = $sale->document_no;
$new->pdf_text =
$new->pdf_text =
"Dostawa
".$sale->shipping_address_name."
".$sale->shipping_address_street."