- paid => '0',
- # %params,
- )->save;
-
- my $expense_chart = SL::DB::Manager::Chart->find_by(accno => '3400');
- my $expense_chart_booking= SL::DB::AccTransaction->new(
- trans_id => $purchase_invoice->id,
- chart_id => $expense_chart->id,
- chart_link => $expense_chart->link,
- amount => '-100',
- transdate => $transdate1,
- source => '',
- taxkey => 9,
- tax_id => SL::DB::Manager::Tax->find_by(taxkey => 9)->id);
- $expense_chart_booking->save;
-
- my $tax_chart = SL::DB::Manager::Chart->find_by(accno => '1576');
- my $tax_chart_booking= SL::DB::AccTransaction->new(
- trans_id => $purchase_invoice->id,
- chart_id => $tax_chart->id,
- chart_link => $tax_chart->link,
- amount => '-19',
- transdate => $transdate1,
- source => '',
- taxkey => 0,
- tax_id => SL::DB::Manager::Tax->find_by(taxkey => 9)->id);
- $tax_chart_booking->save;
- $expense_chart = SL::DB::Manager::Chart->find_by(accno => '3300');
- $expense_chart_booking= SL::DB::AccTransaction->new(
- trans_id => $purchase_invoice->id,
- chart_id => $expense_chart->id,
- chart_link => $expense_chart->link,
- amount => '-100',
- transdate => $transdate1,
- source => '',
- taxkey => 8,
- tax_id => SL::DB::Manager::Tax->find_by(taxkey => 8)->id);
- $expense_chart_booking->save;
-
-
- $tax_chart = SL::DB::Manager::Chart->find_by(accno => '1571');
- $tax_chart_booking= SL::DB::AccTransaction->new(
- trans_id => $purchase_invoice->id,
- chart_id => $tax_chart->id,
- chart_link => $tax_chart->link,
- amount => '-7',
- transdate => $transdate1,
- source => '',
- taxkey => 0,
- tax_id => SL::DB::Manager::Tax->find_by(taxkey => 8)->id);
- $tax_chart_booking->save;
- my $arap_chart = SL::DB::Manager::Chart->find_by(accno => '1600');
- my $arap_booking= SL::DB::AccTransaction->new(trans_id => $purchase_invoice->id,
- chart_id => $arap_chart->id,
- chart_link => $arap_chart->link,
- amount => '226',
- transdate => $transdate1,
- source => '',
- taxkey => 0,
- tax_id => SL::DB::Manager::Tax->find_by(taxkey => 0)->id);
- $arap_booking->save;
-
- return $purchase_invoice;
-}
-
-sub new_item {
- my (%params) = @_;
-
- my $part = delete($params{part}) || $parts[0];
-
- return SL::DB::InvoiceItem->new(
- parts_id => $part->id,
- lastcost => $part->lastcost,
- sellprice => $part->sellprice,
- description => $part->description,
- unit => $part->unit,
- %params,
- );