ahora se procesa de inicio a fin correo por correo
This commit is contained in:
1 parent
99b7caf535
commit
7fa7204442
25 files changed
+2234
-334
No files matched your search
@@ -0,0 +1,33 @@
|
||||
# Construir Draft SAP B1
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A["factura + resultados_val"] --> B["Determinar ItemCode<br>C103002-A (mes anterior)<br>C103002 (mes actual)"]
|
||||
B --> C["Calcular cuotas<br>DocumentInstallments"]
|
||||
|
||||
C --> D{"¿Tiene detracción?"}
|
||||
D -->|Sí| E["Cuota 1: monto detracción<br>U_VS_TIPOCUOTA = D"]
|
||||
E --> F["Cuota 2: neto = total - detracción<br>U_VS_TIPOCUOTA = N"]
|
||||
D -->|No| G["Cuota única por el total<br>U_VS_TIPOCUOTA = N"]
|
||||
|
||||
F --> H["Por cada línea de factura"]
|
||||
G --> H
|
||||
|
||||
H --> I["Obtener guias_lt[]<br>desde resultado_validacion"]
|
||||
I --> J["zona_guia = guias_lt[0]['zona']"]
|
||||
J --> K["Por cada item en guias_lt[]"]
|
||||
|
||||
K --> L["PriceAfterVAT:<br>suma pav FL* si use_sap_prices<br>line_total si no"]
|
||||
L --> M["Qty = item['quantity']"]
|
||||
M --> N["Crear DocumentLine:<br>ItemCode, Quantity,<br>PriceAfterVAT, WarehouseCode,<br>U_IDC_GRFLETE"]
|
||||
|
||||
N --> O["Acumular total_weight<br>+= item['weight1']"]
|
||||
O --> K
|
||||
|
||||
K --> P["U_IDC_VALREF =<br>round((total_weight / 1000) *<br>CUADRO_VALOR_REFERENCIAL[zona], 2)"]
|
||||
|
||||
P --> Q["Armar payload completo"]
|
||||
Q --> R["Cabecera:<br>DocType, CardCode, NumAtCard,<br>DocDate, DocDueDate,<br>U_IDC_NUMGR, Comments"]
|
||||
R --> S["DocumentLines[] +<br>DocumentInstallments[]"]
|
||||
S --> T["← Retornar dict para<br>POST /Drafts"]
|
||||
```
|
||||
Reference in new issue
Block a user