Crea un archivo y lo guarda en la tabla afip_facturas

@param PrintaitorViewObj $printaitorViewObj

@return type boolean true si salio todo bien false caso contrario
320165
public  function send( $printaitorViewObj  ) {    
            $dv = $printaitorViewObj->dataToView;
            $factura['AfipFactura'] = array(
                    'json_data'       => $printaitorViewObj->viewTextRender,
                    'mesa_id'         => Hash::get( $dv, 'Mesa.id'),
                    'importe_total'   => Hash::get( $dv, 'Mesa.total'),
                    'importe_neto'    => Hash::get( $dv, 'importe_neto'),
                    'importe_iva'     => Hash::get( $dv, 'importe_iva'),
                    'punto_de_venta'  => Hash::get( $dv, 'punto_de_venta'),
                    'comprobante_nro' => Hash::get( $dv, 'numero_comprobante'),
                    'tipo_factura_id' => Hash::get( $dv, 'tipo_factura_id'),
                    'cae'             => Hash::get( $dv, 'cae'),
                    'iva_porcentaje'  => Configure::read('Afip.default_iva_porcentaje'),
                );

            $AfipFactura = ClassRegistry::init("Printers.AfipFactura");
            $factura = $AfipFactura->save($factura);
            if ( !$factura ) {
                foreach ( $AfipFactura->validationErrors as $field => $msg) {
                    $msgErr = implode(',', $msg);
                    throw new CakeException( __("No se pudo guardar la factura. Campo: %s, Error: %s", $field, $msgErr), 1);
                }
            }
            return $factura;
        }
889704
public boolean printData(PrintWriter out, int iPrintOptions)
    {
        if ((this.getScreenField().getConverter().getField() instanceof XmlField)
            || (this.getScreenField().getConverter().getField() instanceof HtmlField)
            || (this.getScreenField().getConverter().getField() instanceof XMLPropertiesField))
        {
            boolean bFieldsFound = false;
            String strFieldName = this.getScreenField().getSFieldParam();
            // Do NOT encode the data!
            String strFieldData = this.getScreenField().getSFieldValue(true, false);
            out.println("    <" + strFieldName + '>' + strFieldData + "</" + strFieldName + '>');
            return bFieldsFound;
        }
        else
            return super.printData(out, iPrintOptions);
    }
156323
public function run(): bool
    {
        foreach ($this->collectTestDefinitions() as $key => $testDefinitionCollection) {
            if (count($testDefinitionCollection) > 0) {
                $this->printer->println(
                    $this->printer->colorize(
                        PrinterInterface::CYAN_BACKGROUND . PrinterInterface::WHITE,
                        $this->printGroupHeaderForKeyAndDefinition($key, reset($testDefinitionCollection))
                    )
                );
                /** @var DefinitionInterface $testDefinition */
                foreach ($testDefinitionCollection as $testDefinition) {
                    $this->printer->println($testDefinition->getDescription());
                }
            }
        }

        return true;
    }
388626
public function isInstanceOf(Interfaces\JavaObject $javaObject, $className): bool
    {
        try {
            return $this->pjbProxyClient->isInstanceOf($javaObject, $className);
        } catch (Pjb62BrokenConnectionException | Exception\InvalidUsageException $e) {
            PjbProxyClient::unregisterInstance();
            throw new BrokenConnectionException($e->getMessage(), $e->getCode(), $e);
        }
    }
710222
public function printObj($depth = 0)
    {
        $s = str_repeat("\t", $depth) . $this->name . " " . $this->ns . ' ' . $this->data . "\n";
        foreach ($this->subs as $sub) {
            $s .= $sub->printObj($depth + 1);
        }
        return $s;
    }
1143864
public function renderBeforeScenario($obj)
    {
        $print = array();
        foreach ($this->rendererList as $name => $renderer) {
            $print[$name] = $renderer->renderBeforeScenario($obj);
        }

        return $print;
    }
1302777
public boolean printHeadingFootingData(PrintWriter out, int iPrintOptions)
    {
        boolean bIsBreak = false;
        int iNumCols = this.getSFieldCount();
        for (int iIndex = 0; iIndex < iNumCols; iIndex++)
        {
            ScreenField sField = this.getSField(iIndex);
            boolean bPrintControl = this.isPrintableControl(sField, iPrintOptions);
//x            if (!(sField instanceof ReportBreakScreen))
//x                bPrintControl = false;
            if (sField == this.getReportHeading())
                bPrintControl = false;
            if (sField == this.getReportFooting())
                bPrintControl = false;
            if (sField == this.getReportDetail())
            	bPrintControl = false;
            if ((iPrintOptions & HtmlConstants.HEADING_SCREEN) != 0)
                if ((sField.getDisplayFieldDesc() & HtmlConstants.HEADING_SCREEN) == 0)
                    bPrintControl = false;
            if ((iPrintOptions & HtmlConstants.FOOTING_SCREEN) != 0)
                if ((sField.getDisplayFieldDesc() & HtmlConstants.FOOTING_SCREEN) == 0)
                    bPrintControl = false;
            if (bPrintControl)
            {
                sField.printData(out, iPrintOptions);
                if (!bIsBreak)
                {
                	if (sField instanceof ReportBreakScreen)
                		bIsBreak = ((ReportBreakScreen)sField).isLastBreak();
                	else
                		bIsBreak = true;	// Always assume a break if this is not a break screen
                }
            }
        }
        return bIsBreak;
    }
278428
public function printFiscalText($texto, $doble_ancho = false ,$display = 0){
		$texto = substr($texto,0,30);
		if($doble_ancho){
			$texto = $this->cm('DOBLE_ANCHO').$texto;
		}
		return "A".$this->cm('FS').$texto.$this->cm('FS').$display;
	}
1297992
def print_page_cb(self, print_op, print_context, keep_refs={}):
        
        ORIENTATION_PORTRAIT = 0
        ORIENTATION_LANDSCAPE = 1
        scaling = 2.0

        img = self.img
        (width, height) = img.size

        # take care of rotating the image if required
        if print_context.get_width() <= print_context.get_height():
            print_orientation = ORIENTATION_PORTRAIT
        else:
            print_orientation = ORIENTATION_LANDSCAPE
        if width <= height:
            img_orientation = ORIENTATION_PORTRAIT
        else:
            img_orientation = ORIENTATION_LANDSCAPE
        if print_orientation != img_orientation:
            logger.info("Rotating the page ...")
            img = img.rotate(90, expand=True)

        (width, height) = img.size

        # scale the image down
        # XXX(Jflesch): beware that we get floats for the page size ...
        scaling = min(
            print_context.get_width() / width,
            print_context.get_height() / height
        )

        logger.info("DPI: %fx%f" % (print_context.get_dpi_x(),
                                    print_context.get_dpi_y()))

        surface = image2surface(img)
        keep_refs['surface_cache_' + str(self.page_nb)] = surface

        # .. and print !
        cairo_context = print_context.get_cairo_context()
        cairo_context.scale(scaling, scaling)
        cairo_context.set_source_surface(surface, 0, 0)
        cairo_context.paint()
603003
public boolean printData(PrintWriter out, int iPrintOptions)
    {
        if (!this.isInputField())
            return false;
        if (this.isToolbar())
            return false;
        return this.getScreenFieldView().printData(out, iPrintOptions);
    }
312326
public static Object print(Context cx, Scriptable thisObj,
                               Object[] args, Function funObj)
    {
        return doPrint(args, funObj, true);
    }
983321
public function printStepList(OutputPrinter $printer, $intro, $resultCode, array $stepStats)
    {
        if (!count($stepStats)) {
            return;
        }

        $style = $this->resultConverter->convertResultCodeToString($resultCode);
        $intro = $this->translator->trans($intro, array(), 'output');

        $printer->writeln(sprintf('--- {+%s}%s{-%s}' . PHP_EOL, $style, $intro, $style));

        foreach ($stepStats as $num => $stepStat) {
            if ($stepStat instanceof StepStatV2) {
                $this->printStepStat($printer, $num + 1, $stepStat, $style);
            } elseif ($stepStat instanceof StepStat) {
                $this->printStat($printer, $stepStat->getText(), $stepStat->getPath(), $style, $stepStat->getStdOut(), $stepStat->getError());
            }
        }
    }
203596
public function getPhpWordObjFromTemplate($templateobj)
    {
        $fileName = $templateobj->save();

        $phpWordObject = IOFactory::load($fileName);

        unlink($fileName);

        return $phpWordObject;
    }
656938
public function render($PA, $fObj)
    {
        // Note that the information is passed by reference,
        // so it's possible to manipulate the field directly
        // Here we highlight the field with the color passed as parameter
        $backgroundColor = 'white';
        if (!empty($PA['params']['color'])) {
            $backgroundColor = $PA['params']['color'];
        }
        $PA['item'] = '<div style="background-color: ' . $backgroundColor . '; padding: 4px;">' . $PA['item'] . '</div>';

        // Assemble the wizard itself
        $output = '<div style="margin-top: 8px; margin-left: 4px;">';

        $commonJavascriptCalls = $PA['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] . $PA['fieldChangeFunc']['typo3form.fieldGet'] . ' return false;';
        // Create the + button
        $onClick = "document." . $PA['formName'] . "['" . $PA['itemName'] . "'].value++; " . $commonJavascriptCalls;
        $output .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '" style="padding: 6px; border: 1px solid black; background-color: #999">+</a>';
        // Create the - button
        $onClick = "document." . $PA['formName'] . "['" . $PA['itemName'] . "'].value--; " . $commonJavascriptCalls;
        $output .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '" style="padding: 6px; border: 1px solid black; background-color: #999">-</a>';
        $output .= '</div>';
        return $output;
    }
916043
func (j *JSONPathPrinter) PrintObj(obj runtime.Object, w io.Writer) error {
	// we use reflect.Indirect here in order to obtain the actual value from a pointer.
	// we need an actual value in order to retrieve the package path for an object.
	// using reflect.Indirect indiscriminately is valid here, as all runtime.Objects are supposed to be pointers.
	if InternalObjectPreventer.IsForbidden(reflect.Indirect(reflect.ValueOf(obj)).Type().PkgPath()) {
		return fmt.Errorf(InternalObjectPrinterErr)
	}

	var queryObj interface{} = obj
	if unstructured, ok := obj.(runtime.Unstructured); ok {
		queryObj = unstructured.UnstructuredContent()
	} else {
		data, err := json.Marshal(obj)
		if err != nil {
			return err
		}
		queryObj = map[string]interface{}{}
		if err := json.Unmarshal(data, &queryObj); err != nil {
			return err
		}
	}

	if err := j.JSONPath.Execute(w, queryObj); err != nil {
		buf := bytes.NewBuffer(nil)
		fmt.Fprintf(buf, "Error executing template: %v. Printing more information for debugging the template:\n", err)
		fmt.Fprintf(buf, "\ttemplate was:\n\t\t%v\n", j.rawTemplate)
		fmt.Fprintf(buf, "\tobject given to jsonpath engine was:\n\t\t%#v\n\n", queryObj)
		return fmt.Errorf("error executing jsonpath %q: %v\n", j.rawTemplate, buf.String())
	}
	return nil
}
372934
public function renderBeforeFeature($obj)
    {
        $print = array();
        foreach ($this->rendererList as $name => $renderer) {
            $print[$name] = $renderer->renderBeforeFeature($obj);
        }

        return $print;
    }
1091529
public static function __createOutput ( $printerId  ) {
        // cargar datos de la impresora
        $Printer = ClassRegistry::init("Printers.Printer");
        $Printer->recursive = -1;
        $printer = $Printer->read(null, $printerId);
        if ( empty($printer['Printer']['output']) ) {
            return false;
        }
        $outputName = $printer['Printer']['output'] . 'PrinterOutput';


        // cargar la Salida correspondiente segun la configuracion de la impresora
        App::uses($outputName, 'Printers.Lib/PrinterOutput');
        self::$Output = new $outputName;
        return true;
    }