Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

- some refinements

Gaurav Bhatt20f157b00b15
diff --git a/packages/documents/src/pdf/SalesInvoicePDF.tsx b/packages/documents/src/pdf/SalesInvoicePDF.tsx
index de170ece54..0ffd4d10cb 100644
--- a/packages/documents/src/pdf/SalesInvoicePDF.tsx
+++ b/packages/documents/src/pdf/SalesInvoicePDF.tsx
@@ -191,7 +191,11 @@ const SalesInvoicePDF = ({
{/* RIGHT — Invoice Details + Ship To stacked */}
<View style={tw("w-1/2 flex flex-col")}>
{/* Invoice Details — Due Date prominent */}
- <View style={tw("p-3 border-b border-gray-200")}>
+ <View
+ style={tw(
+ shipmentCustomerName ? "p-3 border-b border-gray-200" : "p-3"
+ )}
+ >
<Text
style={tw("text-[9px] font-bold text-gray-600 mb-1 uppercase")}
>
@@ -231,8 +235,8 @@ const SalesInvoicePDF = ({
</View>
</View>
- {/* Ship To */}
- {(shipmentCustomerName || customerName) && (
+ {/* Ship To — only when shipment has a distinct address (not falling back to customer's main address) */}
+ {shipmentCustomerName && (
<View style={tw("p-3")}>
<Text
style={tw(
@@ -243,15 +247,13 @@ const SalesInvoicePDF = ({
</Text>
<View style={tw("text-[9px] text-gray-800")}>
<AddressBlock
- name={shipmentCustomerName ?? customerName}
- addressLine1={shipmentAddressLine1 ?? customerAddressLine1}
- addressLine2={shipmentAddressLine2 ?? customerAddressLine2}
- city={shipmentCity ?? customerCity}
- stateProvince={
- shipmentStateProvince ?? customerStateProvince
- }
- postalCode={shipmentPostalCode ?? customerPostalCode}
- countryCode={shipmentCountryName ?? customerCountryName}
+ name={shipmentCustomerName}
+ addressLine1={shipmentAddressLine1}
+ addressLine2={shipmentAddressLine2}
+ city={shipmentCity}
+ stateProvince={shipmentStateProvince}
+ postalCode={shipmentPostalCode}
+ countryCode={shipmentCountryName}
/>
</View>
</View>
diff --git a/packages/documents/src/pdf/SalesOrderPDF.tsx b/packages/documents/src/pdf/SalesOrderPDF.tsx
index f862601380..a85674a3d6 100644
--- a/packages/documents/src/pdf/SalesOrderPDF.tsx
+++ b/packages/documents/src/pdf/SalesOrderPDF.tsx
@@ -181,7 +181,11 @@ const SalesOrderPDF = ({
{/* RIGHT — Order Details + Ship To + Bill To stacked */}
<View style={tw("w-1/2 flex flex-col")}>
{/* Order Details */}
- <View style={tw("p-3 border-b border-gray-200")}>
+ <View
+ style={tw(
+ paymentCustomerName ? "p-3 border-b border-gray-200" : "p-3"
+ )}
+ >
<Text
style={tw("text-[9px] font-bold text-gray-600 mb-1 uppercase")}
>
@@ -194,9 +198,7 @@ const SalesOrderPDF = ({
</Text>
)}
{salesOrder?.customerReference && (
- <Text style={tw("font-bold")}>
- Customer PO #: {salesOrder.customerReference}
- </Text>
+ <Text>Customer Ref: {salesOrder.customerReference}</Text>
)}
{salesOrder?.receiptRequestedDate && (
<Text>
@@ -234,27 +236,7 @@ const SalesOrderPDF = ({
</View>
</View>
- {/* Ship To */}
- <View style={tw("p-3 border-b border-gray-200")}>
- <Text
- style={tw("text-[9px] font-bold text-gray-600 mb-1 uppercase")}
- >
- Ship To
- </Text>
- <View style={tw("text-[9px] text-gray-800")}>
- <AddressBlock
- name={customerName}
- addressLine1={customerAddressLine1}
- addressLine2={customerAddressLine2}
- city={customerCity}
- stateProvince={customerStateProvince}
- postalCode={customerPostalCode}
- countryCode={customerCountryName}
- />
- </View>
- </View>
-
- {/* Bill To (only if different from Ship To) */}
+ {/* Bill To (only if a separate billing customer is set) */}
{paymentCustomerName && (
<View style={tw("p-3")}>
<Text