Synchronizes customer payment conditions from SAP B1 into GOAL and aligns them with the Credit Line Management stack.
| SAP source | GOAL target | Notes |
|---|---|---|
OCTG |
payment_terms |
remote_id = GroupNum; import via --import-terms (default on) |
OCRD.GroupNum |
business_partners.sell_payment_term_id |
Customers (CardType = C) |
CRD1 + OCRD fallback |
business_partner_addresses.sell_payment_term_id |
COALESCE(CRD1.GroupNum, OCRD.GroupNum) when CRD1.GroupNum exists |
Credit limits and balances are not updated by this command — use credit sync or the commercial orchestrator below.
php artisan goal:business-partners:sync-payment-terms-from-sap \
--company={companyId} \
[--code=CL00001234] \
[--force] \
[--card-type=C] \
[--limit=10000] [--offset=0] \
[--no-import-terms] \
[--without-confirmation]
Runs payment terms first, then credit:
php artisan goal:business-partners:sync-commercial-from-sap \
--company={companyId} \
[--only=all|credit|payment-terms] \
[--force] [--code=CL...] \
[--no-import-terms] [--without-confirmation]
Recommended before BEES account sync when both commercial fields must match SAP.
SB1_OCRD_PAYMENT_TERM on OCRD / CardCode / UpdateDate with gproc.syncronizations (same pattern as credit sync).--force full customer scan.| Concept | Source |
|---|---|
| How the customer pays | sell_payment_term_id (this sync) |
| Credit limit / balance | credit_limit, balance, has_credit_line (credit sync) |
Credit vs cash term (heuristic): PaymentTerm.days > 0 OR payment term name starts with cr (SAP PymntGroup LIKE 'cr%').
Warnings (no auto mutation of credit fields):
Credit summary API (GET .../business-partners/{id}/credit-summary) includes:
sell_payment_term_id, sell_payment_term_name, sell_payment_term_daysis_credit_payment_term, credit_purchase_allowedshipping_addresses[] entryapply_credit_charge, credit_charge_applicable (partner, addresses, sales teams) — see online-store-credit-charges.md| Class | Role |
|---|---|
SyncBusinessPartnerPaymentTermsFromSapAction |
Orchestrator |
ApplySapPartnerPaymentTermSnapshotAction |
Partner row |
ApplySapAddressPaymentTermSnapshotsAction |
Address rows |
SyncBusinessPartnerCommercialFromSapAction |
Payment terms + credit |
PaymentTermCreditClassifier |
Credit vs cash heuristic |
No new public REST endpoint; credit summary is extended on the existing credit-line summary route.