fix: [sales,pricing] 매출 0원 + 단가 수정 0원 수정
This commit is contained in:
@@ -180,16 +180,18 @@ public static function createFromOrder(Order $order, string $saleNumber): self
|
||||
*/
|
||||
public static function createFromShipment(Shipment $shipment, string $saleNumber): self
|
||||
{
|
||||
$order = $shipment->order;
|
||||
|
||||
return new self([
|
||||
'tenant_id' => $shipment->tenant_id,
|
||||
'order_id' => $shipment->order_id,
|
||||
'shipment_id' => $shipment->id,
|
||||
'sale_number' => $saleNumber,
|
||||
'sale_date' => $shipment->shipped_date ?? now()->toDateString(),
|
||||
'client_id' => $shipment->order?->client_id,
|
||||
'supply_amount' => $shipment->total_amount / 1.1, // 세전 역산
|
||||
'tax_amount' => $shipment->total_amount - ($shipment->total_amount / 1.1),
|
||||
'total_amount' => $shipment->total_amount,
|
||||
'client_id' => $order?->client_id,
|
||||
'supply_amount' => $order?->supply_amount ?? 0,
|
||||
'tax_amount' => $order?->tax_amount ?? 0,
|
||||
'total_amount' => $order?->total_amount ?? 0,
|
||||
'description' => "출하 {$shipment->shipment_no} 매출",
|
||||
'status' => 'draft',
|
||||
'source_type' => self::SOURCE_SHIPMENT_COMPLETE,
|
||||
|
||||
Reference in New Issue
Block a user