Skip to content

Commit

Permalink
Merge pull request #1231 from daniel89fg/pipe_clone_lines
Browse files Browse the repository at this point in the history
Pipe clone lines
  • Loading branch information
NeoRazorX committed Jun 17, 2022
2 parents 1cdc946 + 99bdceb commit 8a48aa4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Core/Lib/BusinessDocumentGenerator.php
Expand Up @@ -20,6 +20,7 @@
namespace FacturaScripts\Core\Lib;

use FacturaScripts\Core\Base\Calculator;
use FacturaScripts\Core\Base\ExtensionsTrait;
use FacturaScripts\Core\Model\Base\BusinessDocument;
use FacturaScripts\Core\Model\Base\BusinessDocumentLine;
use FacturaScripts\Dinamic\Model\DocTransformation;
Expand All @@ -33,6 +34,8 @@
class BusinessDocumentGenerator
{

use ExtensionsTrait;

/**
* Document fields to exclude.
*
Expand Down Expand Up @@ -177,6 +180,14 @@ protected function cloneLines(BusinessDocument $prototype, BusinessDocument $new
if (!empty($line->primaryColumnValue()) && !$docTrans->save()) {
return false;
}

if (false === $this->pipeFalse('cloneLine', $prototype, $line, $newLine->cantidad, $newDoc, $newLine)) {
return false;
}
}

if (false === $this->pipeFalse('cloneLines', $prototype, $newDoc, $lines, $quantity)) {
return false;
}

return true;
Expand Down

0 comments on commit 8a48aa4

Please sign in to comment.