Fixed issue of importing invoice and bill

refs #2710
This commit is contained in:
EnesSacid-Buker 2023-02-20 13:00:59 +03:00
parent dc2ca953dd
commit a96d326f09
No known key found for this signature in database
GPG Key ID: 13B101B7922E1730
15 changed files with 25 additions and 0 deletions

View File

@ -20,6 +20,8 @@ class BillHistories extends Import
return [];
}
$row['bill_number'] = (string) $row['bill_number'];
$row = parent::map($row);
$row['document_id'] = (int) Document::bill()->number($row['bill_number'])->pluck('id')->first();

View File

@ -22,6 +22,8 @@ class BillItemTaxes extends Import
return [];
}
$row['bill_number'] = (string) $row['bill_number'];
$row = parent::map($row);
$row['document_id'] = (int) Document::bill()->number($row['bill_number'])->pluck('id')->first();

View File

@ -20,6 +20,8 @@ class BillItems extends Import
return [];
}
$row['bill_number'] = (string) $row['bill_number'];
$row = parent::map($row);
$row['document_id'] = (int) Document::bill()->number($row['bill_number'])->pluck('id')->first();

View File

@ -20,6 +20,8 @@ class BillTotals extends Import
return [];
}
$row['bill_number'] = (string) $row['bill_number'];
$row = parent::map($row);
$row['document_id'] = (int) Document::bill()->number($row['bill_number'])->pluck('id')->first();

View File

@ -19,6 +19,8 @@ class BillTransactions extends Import
return [];
}
$row['bill_number'] = (string) $row['bill_number'];
$row = parent::map($row);
$row['type'] = 'expense';

View File

@ -20,6 +20,8 @@ class Bills extends Import
return [];
}
$row['bill_number'] = (string) $row['bill_number'];
$row = parent::map($row);
$country = array_search($row['contact_country'], trans('countries'));

View File

@ -20,6 +20,8 @@ class InvoiceHistories extends Import
return [];
}
$row['invoice_number'] = (string) $row['invoice_number'];
$row = parent::map($row);
$row['document_id'] = (int) Document::invoice()->number($row['invoice_number'])->pluck('id')->first();

View File

@ -22,6 +22,8 @@ class InvoiceItemTaxes extends Import
return [];
}
$row['invoice_number'] = (string) $row['invoice_number'];
$row = parent::map($row);
$row['document_id'] = (int) Document::invoice()->number($row['invoice_number'])->pluck('id')->first();

View File

@ -20,6 +20,8 @@ class InvoiceItems extends Import
return [];
}
$row['invoice_number'] = (string) $row['invoice_number'];
$row = parent::map($row);
$row['document_id'] = (int) Document::invoice()->number($row['invoice_number'])->pluck('id')->first();

View File

@ -20,6 +20,8 @@ class InvoiceTotals extends Import
return [];
}
$row['invoice_number'] = (string) $row['invoice_number'];
$row = parent::map($row);
$row['document_id'] = (int) Document::invoice()->number($row['invoice_number'])->pluck('id')->first();

View File

@ -19,6 +19,8 @@ class InvoiceTransactions extends Import
return [];
}
$row['invoice_number'] = (string) $row['invoice_number'];
$row = parent::map($row);
$row['type'] = 'income';

View File

@ -20,6 +20,8 @@ class Invoices extends Import
return [];
}
$row['invoice_number'] = (string) $row['invoice_number'];
$row = parent::map($row);
$country = array_search($row['contact_country'], trans('countries'));

View File

@ -327,6 +327,7 @@ trait Import
$data = [
'company_id' => company_id(),
'type' => $row['item_type'],
'name' => $row['item_name'],
'sale_price' => !empty($row['sale_price']) ? $row['sale_price'] : (!empty($row['price']) ? $row['price'] : 0),
'purchase_price' => !empty($row['purchase_price']) ? $row['purchase_price'] : (!empty($row['price']) ? $row['price'] : 0),

Binary file not shown.

Binary file not shown.